Examples of ByteBufferInputStream


Examples of org.jnode.util.ByteBufferInputStream

        try {
            raf = new RandomAccessFile(file, "r");
            ByteBuffer bb = IOUtils.getSectorsByteBuffer(raf, firstSector, nbSectors);

            Reader r = new InputStreamReader(new ByteBufferInputStream(bb));
            br = new BufferedReader(r);

            Header header = readHeader(br);

            List<String> extentDecls = new ArrayList<String>();
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

   }
  

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

      int operationCode = in.readUnsignedByte();
      if (operationCode != OPERATION_CODE)
      {
         throw new IOException("Invalid operation code: " + Integer.toHexString(operationCode));
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

public class SenseDataFactory implements Serializer
{
   @SuppressWarnings("unchecked")
   public SenseData decode(ByteBuffer buffer) throws IOException
   {
      DataInputStream in = new DataInputStream(new ByteBufferInputStream(buffer));

      int b1 = in.readUnsignedByte();
      ResponseCode code = ResponseCode.valueOf((byte) (b1 & 0x7F)); // throws IOException

      SenseData sense = null;
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

      this(dbd, pageControl, pageCode, subPageCode, false, false, allocationLength);
   }

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

      int operationCode = in.readUnsignedByte();
      this.DBD = (in.readUnsignedByte() & 0x08) != 0;
      tmp = in.readUnsignedByte();
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

   {
      assert header != null && header.length == 1 : "input header is invalid";
      boolean valid = (header[0] & 0x80) != 0;
      this.setResponseCode(ResponseCode.valueOf((byte) (header[0] & 0x7F)));

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

      // 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];
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

   /////////////////////////////////////////////////////////////////////////////
   // constructors

   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);
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

      this(false, false, logicalBlockAddress, transferLength);
   }

   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();
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

      this(evpd, pageCode, false, false, allocationLength);
   }

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

      int operationCode = in.readUnsignedByte();
      this.EVPD = (in.readUnsignedByte() & 0x01) == 0x01;
      this.pageCode = in.readUnsignedByte();
      setAllocationLength(in.readUnsignedShort());
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

      this(false, false, allocationLength);
   }

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

      int operationCode = in.readUnsignedByte();
      int serviceAction = in.readUnsignedByte() & 0x1F;
      in.readInt();
      long mss = in.readUnsignedShort();
View Full Code Here

Examples of org.jscsi.scsi.protocol.util.ByteBufferInputStream

         this.subPageCode = 0;
         pageLength = header[1];
         dataLength = pageLength - 2;
      }

      DataInputStream dataIn = new DataInputStream(new ByteBufferInputStream(buffer));
      decodeModeParameters(dataLength, dataIn);
   }
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.