Package java.io

Examples of java.io.DataInputStream.readByte()


    {
        DataInputStream input = new DataInputStream(inputStream);
        char headersize = input.readChar();
        int readcount = 2;
        //reading the header format
        byte magic1 = input.readByte();
        readcount ++;
        byte magic2 = input.readByte();
        readcount ++;
        if (magic1 != MAGIC1 || magic2 != MAGIC2) {
            throw new IOException(MAGIC_NUMBER_AUTHENTICATION_FAILED_);
View Full Code Here


        char headersize = input.readChar();
        int readcount = 2;
        //reading the header format
        byte magic1 = input.readByte();
        readcount ++;
        byte magic2 = input.readByte();
        readcount ++;
        if (magic1 != MAGIC1 || magic2 != MAGIC2) {
            throw new IOException(MAGIC_NUMBER_AUTHENTICATION_FAILED_);
        }
View Full Code Here

        input.readChar(); // reading size
        readcount += 2;
        input.readChar(); // reading reserved word
        readcount += 2;
        byte bigendian    = input.readByte();
        readcount ++;
        byte charset      = input.readByte();
        readcount ++;
        byte charsize     = input.readByte();
        readcount ++;
View Full Code Here

        readcount += 2;
        input.readChar(); // reading reserved word
        readcount += 2;
        byte bigendian    = input.readByte();
        readcount ++;
        byte charset      = input.readByte();
        readcount ++;
        byte charsize     = input.readByte();
        readcount ++;
        input.readByte(); // reading reserved byte
        readcount ++;
View Full Code Here

        readcount += 2;
        byte bigendian    = input.readByte();
        readcount ++;
        byte charset      = input.readByte();
        readcount ++;
        byte charsize     = input.readByte();
        readcount ++;
        input.readByte(); // reading reserved byte
        readcount ++;

        byte dataFormatID[] = new byte[4];
View Full Code Here

        readcount ++;
        byte charset      = input.readByte();
        readcount ++;
        byte charsize     = input.readByte();
        readcount ++;
        input.readByte(); // reading reserved byte
        readcount ++;

        byte dataFormatID[] = new byte[4];
        input.readFully(dataFormatID);
        readcount += 4;
View Full Code Here

    public VoldemortOperation(byte[] bytes) {
        if(bytes == null || bytes.length <= 1)
            throw new SerializationException("Not enough bytes to serialize");
        DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(bytes));
        try {
            this.opCode = inputStream.readByte();
            switch(opCode) {
                case VoldemortOpCode.GET_OP_CODE:
                    this.version = null;
                    this.key = inputStream.readUTF();
                    this.value = null;
View Full Code Here

        try {
          stream = new DataInputStream(new HashInputStream(key));
 
          for (int i = 0; i < hashes.length; i++) {
              try {
                  hashes[i] = stream.readByte();
              } catch (IOException e) {
                  // Shouldn't be possible
                  throw new IllegalStateException("Hash generation failed", e);
              }
          }
View Full Code Here

    {
        try (
            ByteArrayInputStream bs = new ByteArrayInputStream(data.clone());
            DataInputStream ds = new DataInputStream(bs);)
            {
            byte senderType = ds.readByte();
            byte endType = ds.readByte();
            byte sender = ds.readByte();
            byte end = ds.readByte();
            byte packetType = ds.readByte();
           
View Full Code Here

        try (
            ByteArrayInputStream bs = new ByteArrayInputStream(data.clone());
            DataInputStream ds = new DataInputStream(bs);)
            {
            byte senderType = ds.readByte();
            byte endType = ds.readByte();
            byte sender = ds.readByte();
            byte end = ds.readByte();
            byte packetType = ds.readByte();
           
            if (packetType == DISCOVER_CC_COMPUTERS && this.computer != null)
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.