Package java.io

Examples of java.io.DataInputStream.readUnsignedByte()


      // read in first segment of fixed format sense data
      in.readByte();
      int key = in.readUnsignedByte() & 0x0F; // TODO: FILEMARK, EOM, and ILI are unsupported
      byte[] info = new byte[4];
      in.read(info);
      int length = in.readUnsignedByte() - 10; // length of next segment, minus required read-in
      length = length < 0 ? 0 : length;

      // read in the next segment of the fixed format sense data
      byte[] cmdi = new byte[4];
      in.read(cmdi);
View Full Code Here


      length = length < 0 ? 0 : length;

      // read in the next segment of the fixed format sense data
      byte[] cmdi = new byte[4];
      in.read(cmdi);
      int code = in.readUnsignedByte();
      int qualifier = in.readUnsignedByte();
      in.readByte();
      this.senseKeySpecificBuffer = new byte[3];
      in.read(this.senseKeySpecificBuffer);
      // the rest of the additional sense bytes are ignored
View Full Code Here

      // read in the next segment of the fixed format sense data
      byte[] cmdi = new byte[4];
      in.read(cmdi);
      int code = in.readUnsignedByte();
      int qualifier = in.readUnsignedByte();
      in.readByte();
      this.senseKeySpecificBuffer = new byte[3];
      in.read(this.senseKeySpecificBuffer);
      // the rest of the additional sense bytes are ignored
      // (vendor specific bytes not supported)
View Full Code Here

   public void decode(byte[] header, ByteBuffer buffer) throws IOException
   {
      DataInputStream in = new DataInputStream(new ByteBufferInputStream(buffer));

      // byte 0
      int b0 = in.readUnsignedByte();
      this.setPeripheralQualifier(b0 >>> 5);
      this.setPeripheralDeviceType(b0 & 0x1F);

      // byte 1
      int b1 = in.readUnsignedByte();
View Full Code Here

      int b0 = in.readUnsignedByte();
      this.setPeripheralQualifier(b0 >>> 5);
      this.setPeripheralDeviceType(b0 & 0x1F);

      // byte 1
      int b1 = in.readUnsignedByte();

      if (b1 != PAGE_CODE)
      {
         throw new IOException("invalid page code: " + Integer.toHexString(b1));
      }
View Full Code Here

      }

      this.setPageCode(b1);

      // byte 2
      in.readUnsignedByte();

      // byte 3
      int b3 = in.readUnsignedByte();

      // supported codes list
View Full Code Here

      // byte 2
      in.readUnsignedByte();

      // byte 3
      int b3 = in.readUnsignedByte();

      // supported codes list
      for (int i = b3; i > 0; i--)
      {
         this.supportedCodes.add(in.readUnsignedByte());
View Full Code Here

      int b3 = in.readUnsignedByte();

      // supported codes list
      for (int i = b3; i > 0; i--)
      {
         this.supportedCodes.add(in.readUnsignedByte());
      }
   }

   public byte[] encode()
   {
View Full Code Here

   public void decode(byte[] header, ByteBuffer input) throws IOException
   {
      DataInputStream in = new DataInputStream(new ByteBufferInputStream(input));

      int operationCode = in.readUnsignedByte();

      long msb = in.readUnsignedByte() & 0x1F;
      long lss = in.readUnsignedShort();
      setLogicalBlockAddress((msb << 16) | lss);
View Full Code Here

   {
      DataInputStream in = new DataInputStream(new ByteBufferInputStream(input));

      int operationCode = in.readUnsignedByte();

      long msb = in.readUnsignedByte() & 0x1F;
      long lss = in.readUnsignedShort();
      setLogicalBlockAddress((msb << 16) | lss);

      setTransferLength(in.readUnsignedByte());
      if (getTransferLength() == 0)
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.