Package java.io

Examples of java.io.DataOutputStream.writeShort()


      BlockType bt = BlockType.values()[blockTypeOrdinal];
      DataOutputStream dos = hbw.startWriting(bt);
      int size = rand.nextInt(500);
      for (int j = 0; j < size; ++j) {
        // This might compress well.
        dos.writeShort(i + 1);
        dos.writeInt(j + 1);
      }

      if (expectedOffsets != null)
        expectedOffsets.add(os.getPos());
View Full Code Here


            out.writeByte(0); // BLOCK DESCRIPTOR LENGTH is 0; block descriptors are unsupported
         }
         else if (cdb.getOperationCode() == ModeSense10.OPERATION_CODE)
         {
            _logger.trace("Assembling return data for MODE SENSE (10)");
            out.writeShort(0); // MODE DATA LENGTH placeholder, will be replaced later
            out.writeByte(0x00); // MEDIUM TYPE set to 0x00 according to SBC-2
            out.writeByte(devspec); // DEVICE-SPECIFIC PARAMETER
            out.writeShort(0); // Reserved, LONGLBA=0, Reserved
            out.writeShort(0); // BLOCK DESCRIPTOR LENGTH is 0; block descriptors are unsupported
         }
View Full Code Here

         {
            _logger.trace("Assembling return data for MODE SENSE (10)");
            out.writeShort(0); // MODE DATA LENGTH placeholder, will be replaced later
            out.writeByte(0x00); // MEDIUM TYPE set to 0x00 according to SBC-2
            out.writeByte(devspec); // DEVICE-SPECIFIC PARAMETER
            out.writeShort(0); // Reserved, LONGLBA=0, Reserved
            out.writeShort(0); // BLOCK DESCRIPTOR LENGTH is 0; block descriptors are unsupported
         }
         else
         {
            throw new RuntimeException("Invalid operation code for MODE SENSE task: "
View Full Code Here

            _logger.trace("Assembling return data for MODE SENSE (10)");
            out.writeShort(0); // MODE DATA LENGTH placeholder, will be replaced later
            out.writeByte(0x00); // MEDIUM TYPE set to 0x00 according to SBC-2
            out.writeByte(devspec); // DEVICE-SPECIFIC PARAMETER
            out.writeShort(0); // Reserved, LONGLBA=0, Reserved
            out.writeShort(0); // BLOCK DESCRIPTOR LENGTH is 0; block descriptors are unsupported
         }
         else
         {
            throw new RuntimeException("Invalid operation code for MODE SENSE task: "
                  + cdb.getOperationCode());
View Full Code Here

         tmp |= ((this.BYTCHK ? 1 : 0 << 1));
         out.writeByte(tmp);
        
         out.writeInt(this.lba);
         out.writeByte(this.groupNumber);
         out.writeShort(this.verificationLength);
         out.writeByte(super.getControl());

         return cdb.toByteArray();
      }
      catch (IOException e)
View Full Code Here

         out.writeByte(OPERATION_CODE);

         int msb = (int) (getLogicalBlockAddress() >>> 16) & 0x1F;
         int lss = (int) getLogicalBlockAddress() & 0xFFFF;
         out.writeByte(msb);
         out.writeShort(lss);
         if (getTransferLength() == 256)
         {
            out.writeByte(0);
         }
         else
View Full Code Here

      try
      {
         out.writeByte(OPERATION_CODE);
         out.writeByte(this.EVPD ? 0x01 : 0x00);
         out.writeByte(this.pageCode);
         out.writeShort((short) getAllocationLength());
         out.writeByte(super.getControl());

         return cdb.toByteArray();
      }
      catch (IOException e)
View Full Code Here

         dataOut.writeByte(b0);

         if (isSubPageFormat())
         {
            dataOut.writeByte(getSubPageCode());
            dataOut.writeShort(getPageLength());
         }
         else
         {
            dataOut.writeByte(getPageLength());
         }
View Full Code Here

         out.writeByte(this.encodeByte1());

         out.writeInt((int) getLogicalBlockAddress());
         out.writeByte(this.groupNumber & 0x1F);
         out.writeShort((int) getTransferLength());
         out.writeByte(super.getControl());

         return cdb.toByteArray();
      }
      catch (IOException e)
View Full Code Here

         // byte 1
         out.writeByte(this.getPageCode());

         // byte 2 - 3
         out.writeShort(pageLength);

         // identification descriptor list
         for (IdentificationDescriptor id : this.descriptorList)
         {
            out.write(id.encode());
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.