Package java.io

Examples of java.io.DataInputStream.readShort()


      }
      reader.readShort(); // color map origin, ignore because no color map
      reader.readShort(); // color map length, ignore because no color map
      reader.readByte(); // color map entry size, ignore because no color
                // map
      reader.readShort(); // x origin
      reader.readShort(); // y origin

      cc = reader.readByte(); // image width low byte
      short s = (short) ((short) cc & 0x00ff);
      cc = reader.readByte(); // image width high byte
View Full Code Here


      reader.readShort(); // color map origin, ignore because no color map
      reader.readShort(); // color map length, ignore because no color map
      reader.readByte(); // color map entry size, ignore because no color
                // map
      reader.readShort(); // x origin
      reader.readShort(); // y origin

      cc = reader.readByte(); // image width low byte
      short s = (short) ((short) cc & 0x00ff);
      cc = reader.readByte(); // image width high byte
      s = (short) ((short) (((short) cc & 0x00ff) << 8) | s);
View Full Code Here

      this.LLBAA = (tmp & 0x01) != 0;
      tmp = in.readUnsignedByte();
      this.setPageCode(tmp & 0x3F);
      this.setPC(tmp >>> 6);
      this.setSubPageCode(in.readUnsignedByte());
      in.readShort(); // first part of RESERVED block
      in.readByte(); // remaining RESERVED block
      setAllocationLength(in.readUnsignedShort());

      super.setControl(in.readUnsignedByte());
View Full Code Here

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

      int operationCode = in.readUnsignedByte();
      int format = in.readUnsignedByte() & 0x01;
      this.DESC = (format == 1);
      in.readShort();
      setAllocationLength(in.readUnsignedByte());
      super.setControl(in.readUnsignedByte());

      if (operationCode != OPERATION_CODE)
      {
View Full Code Here

      int operationCode = in.readUnsignedByte();
      in.readByte();
      long mss = in.readUnsignedShort();
      long lss = in.readUnsignedShort();
      this.logicalBlockAddress = (mss << 16) | lss;
      in.readShort();
      this.PMI = (in.readUnsignedByte() & 1) != 0;
      super.setControl(in.readUnsignedByte());

      if (operationCode != OPERATION_CODE)
      {
View Full Code Here

        // as good as real CRC16). I don't know if any encoder implementation
        // sets this, so it's not worth trying to verify it. GNU gzip 1.4
        // doesn't support this field, but zlib seems to be able to at least
        // skip over it.
        if ((flg & FHCRC) != 0) {
            inData.readShort();
        }

        // Reset
        inf.reset();
        crc.reset();
View Full Code Here

        if (enhancedFormat) {
          identifier = dataInputStream.readInt();
          expiry = dataInputStream.readInt();
        }

        int deviceTokenLength = dataInputStream.readShort();
        byte[] deviceTokenBytes = toArray(inputStream,
            deviceTokenLength);

        int payloadLength = dataInputStream.readShort();
        byte[] payloadBytes = toArray(inputStream, payloadLength);
View Full Code Here

        int deviceTokenLength = dataInputStream.readShort();
        byte[] deviceTokenBytes = toArray(inputStream,
            deviceTokenLength);

        int payloadLength = dataInputStream.readShort();
        byte[] payloadBytes = toArray(inputStream, payloadLength);

        ApnsNotification message;
        if (enhancedFormat) {
          message = new EnhancedApnsNotification(identifier, expiry,
View Full Code Here

    DataInputStream in=null;
    try {
      in = new DataInputStream(
          new BufferedInputStream(NetUtils.getInputStream(s),
                                  SMALL_BUFFER_SIZE));
      short version = in.readShort();
      if ( version != DataTransferProtocol.DATA_TRANSFER_VERSION ) {
        throw new IOException( "Version Mismatch" );
      }
      boolean local = s.getInetAddress().equals(s.getLocalAddress());
      updateThreadName("waiting for operation");
View Full Code Here

          blockReceiver.writeChecksumHeader(mirrorOut);
          mirrorOut.flush();

          // read connect ack (only for clients, not for replication req)
          if (client.length() != 0) {
            mirrorInStatus = mirrorIn.readShort();
            firstBadLink = Text.readString(mirrorIn);
            if (LOG.isDebugEnabled() || mirrorInStatus != DataTransferProtocol.OP_STATUS_SUCCESS) {
              LOG.info("Datanode " + targets.length +
                       " got response for connect ack " +
                       " from downstream datanode with firstbadlink as " +
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.