Package java.io

Examples of java.io.DataInputStream.readByte()


         
          relay_address = InetAddress.getByAddress( bytes );

        }
       
        int  relay_port = ((dis.readByte()<<8)&0xff00) | (dis.readByte() & 0x00ff );
         
        if ( relay_address.isAnyLocalAddress()){
         
          relay_address = control_socket.getInetAddress();
        }
View Full Code Here


    int    data_len  = packet.getLength();
   
    DataInputStream dis = new DataInputStream( new ByteArrayInputStream( data, 0, data_len ));
   
    try{
      dis.readByte()// res
      dis.readByte()// res
      dis.readByte()// assume no frag
   
      byte  atype = dis.readByte();
     
View Full Code Here

   
    DataInputStream dis = new DataInputStream( new ByteArrayInputStream( data, 0, data_len ));
   
    try{
      dis.readByte()// res
      dis.readByte()// res
      dis.readByte()// assume no frag
   
      byte  atype = dis.readByte();
     
      int  encap_len = 4;
View Full Code Here

    DataInputStream dis = new DataInputStream( new ByteArrayInputStream( data, 0, data_len ));
   
    try{
      dis.readByte()// res
      dis.readByte()// res
      dis.readByte()// assume no frag
   
      byte  atype = dis.readByte();
     
      int  encap_len = 4;
      if ( atype == 1 ){
View Full Code Here

    try{
      dis.readByte()// res
      dis.readByte()// res
      dis.readByte()// assume no frag
   
      byte  atype = dis.readByte();
     
      int  encap_len = 4;
      if ( atype == 1 ){
       
        encap_len += 4;
View Full Code Here

       
        encap_len += 4;
       
      }else if ( atype == 3 ){
       
        encap_len += 1 + (dis.readByte()&0xff);
       
      }else{
       
        encap_len += 16;
      }
View Full Code Here

        byte[] magicNumber = IOUtil.readBytes(in, MAGIC_NUMBER.length);
        if (!Arrays.equals(magicNumber, MAGIC_NUMBER)) {
          throw new IOException("File doesn't contain compatible namespace data");
        }

        byte version = in.readByte();
        if (version > FILE_FORMAT_VERSION) {
          throw new IOException("Unable to read namespace file; it uses a newer file format");
        }
        else if (version != FILE_FORMAT_VERSION) {
          throw new IOException("Unable to read namespace file; invalid file format version: " + version);
View Full Code Here

      // The rest of the data is GZIP-compressed
      DataInputStream dataIn = new DataInputStream(new GZIPInputStream(in));
      in = dataIn;

      int recordTypeMarker;
      while ((recordTypeMarker = dataIn.readByte()) != EOF_MARKER) {
        switch (recordTypeMarker) {
          case NAMESPACE_MARKER:
            readNamespace(dataIn);
            break;
          case EXPL_TRIPLE_MARKER:
View Full Code Here

            DataInputStream is = new DataInputStream( m_backendIS );
            while ( !m_disposed )
            {
                // A Packet code must exist.
                byte code = is.readByte();
               
                // Always read from the buffer until a null '\0' is encountered.
                byte b;
                int i = 0;
                do
View Full Code Here

                // Always read from the buffer until a null '\0' is encountered.
                byte b;
                int i = 0;
                do
                {
                    b = is.readByte();
                    if ( b != 0 )
                    {
                        if ( i >= m_backendReadBuffer.length )
                        {
                            byte[] tmp = m_backendReadBuffer;
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.