Package java.io

Examples of java.io.DataInputStream.available()


                case Leader.PING:
                    // Process the touches
                    ByteArrayInputStream bis = new ByteArrayInputStream(qp
                            .getData());
                    DataInputStream dis = new DataInputStream(bis);
                    while (dis.available() > 0) {
                        long sess = dis.readLong();
                        int to = dis.readInt();
                        leader.zk.touch(sess, to);
                    }
                    break;
View Full Code Here


      in.readFully(buff);
      instanceFails = !Arrays.equals(buff, HdfsZooInstance.getInstance().getInstanceID().getBytes());
      buff = new byte[in.readInt()];
      in.readFully(buff);
      confFails = !Arrays.equals(buff, getSystemConfigChecksum());
      if (in.available() > 0)
        throw new IOException();
    } catch (IOException e) {
      return TabletServerState.BAD_SYSTEM_PASSWORD;
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException("Failed to compare system password", e);
View Full Code Here

                    ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionId = new byte[size];
                            readIn.read( connectionId );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
View Full Code Here

                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                                new String( connectionId, "UTF-8" ) );
                        }

                        IEntry entry = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new LdapDN( new String( dn, "UTF-8" ) ) );
View Full Code Here

                        if ( entry != null )
                        {
                            entryList.add( entry );
                        }
                    }
                    while ( readIn.available() > 1 );

                    readIn.close();
                }
                catch ( IOException ex )
                {
View Full Code Here

                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        IBrowserConnection connection = null;
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionId = new byte[size];
                            readIn.read( connectionId );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
View Full Code Here

                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
                                new String( connectionId, "UTF-8" ) );
                        }

                        IEntry entry = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new LdapDN( new String( dn, "UTF-8" ) ) );
View Full Code Here

                        {
                            return null;
                        }

                        IAttribute attribute = null;
                        if ( readIn.available() > 1 && entry != null )
                        {
                            int size = readIn.readInt();
                            byte[] attributeName = new byte[size];
                            readIn.read( attributeName );
                            attribute = entry.getAttribute( new String( attributeName, "UTF-8" ) );
View Full Code Here

                        {
                            return null;
                        }

                        IValue value = null;
                        if ( readIn.available() > 1 && attribute != null )
                        {
                            boolean isString = readIn.readBoolean();
                            int size = readIn.readInt();
                            byte[] val = new byte[size];
                            readIn.read( val );
View Full Code Here

                        if ( value != null )
                        {
                            valueList.add( value );
                        }
                    }
                    while ( readIn.available() > 1 );

                    readIn.close();
                }
                catch ( IOException ex )
                {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.