Examples of readShort()


Examples of org.jboss.invocation.MarshalledValueInputStream.readShort()

                                    : NodeFactory.NODE_TYPE_TREENODE;
      this.internalFqns = cache.getInternalFqns();
     
      ByteArrayInputStream bais = new ByteArrayInputStream(state);
      MarshalledValueInputStream in = new MarshalledValueInputStream(bais);
      in.readShort(); // the version, which we discard
      transientSize  = in.readInt();
      associatedSize = in.readInt();
      persistentSize = in.readInt();
      in.close();
      if (log.isTraceEnabled()) {
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readShort()

            throw new MalformedCommandException("binary request payload is invalid, magic byte incorrect");
        }

        short opcode = headerBuffer.readUnsignedByte();
        short keyLength = headerBuffer.readShort();
        short extraLength = headerBuffer.readUnsignedByte();
        short dataType = headerBuffer.readUnsignedByte();   // unused
        short reserved = headerBuffer.readShort(); // unused
        int totalBodyLength = headerBuffer.readInt();
        int opaque = headerBuffer.readInt();
View Full Code Here

Examples of org.jboss.soa.esb.message.body.content.BytesBody.readShort()

   
    mapMessage.readMode();

    assertEquals(mapMessage.readInt(), 12345);
    assertEquals(mapMessage.readUTFString(), "hello world");
    assertEquals(mapMessage.readShort(), (short) 10);
    assertEquals(mapMessage.readBoolean(), true);
  }
}
View Full Code Here

Examples of org.jboss.util.stream.MarshalledValueInputStream.readShort()

   public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException {
      int versionId;
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes, offset, len));
      try {
         versionId = in.readShort();
         log.trace("Read version {0}", versionId);
      }
      catch (Exception e) {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
         throw new IOException("Unable to read version id from first two bytes of stream.");
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataInputStream.readShort()

        for(int i=Short.MIN_VALUE; i <= Short.MAX_VALUE; i++)
            out.writeShort(i);

        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(int i=Short.MIN_VALUE; i <= Short.MAX_VALUE; i++) {
            short read=in.readShort();
            assert i == read;
        }
    }

    public void testUnsignedShort() throws IOException {
View Full Code Here

Examples of org.jnode.awt.font.truetype.TTFInput.readShort()

            return glyphs[i];
        } else {
            final TTFInput in = getInput();
            in.pushPos();
            in.seek(offsets[i]);
            int numberOfContours = in.readShort();
            if (numberOfContours >= 0) {
                glyphs[i] = new SimpleGlyph(in, numberOfContours);
            } else {
                glyphs[i] = new CompositeGlyph(in, this);
            }
View Full Code Here

Examples of org.lilyproject.bytes.api.DataInput.readShort()

        Assert.assertArrayEquals(bytes, dataInput.readBytes(10));
        Assert.assertEquals(d, dataInput.readDouble(), 0.0001);
        Assert.assertEquals(f, dataInput.readFloat(), 0.0001);
        Assert.assertEquals(i, dataInput.readInt());
        Assert.assertEquals(l, dataInput.readLong());
        Assert.assertEquals(s, dataInput.readShort());
        Assert.assertEquals(string, dataInput.readUTF());
        Assert.assertEquals(Math.abs(i), dataInput.readVInt());
        Assert.assertEquals(Math.abs(l), dataInput.readVLong());
    }
View Full Code Here

Examples of org.lilyproject.bytes.impl.DataInputImpl.readShort()

        Assert.assertArrayEquals(bytes, dataInput.readBytes(10));
        Assert.assertEquals(d, dataInput.readDouble(), 0.0001);
        Assert.assertEquals(f, dataInput.readFloat(), 0.0001);
        Assert.assertEquals(i, dataInput.readInt());
        Assert.assertEquals(l, dataInput.readLong());
        Assert.assertEquals(s, dataInput.readShort());
        Assert.assertEquals(string, dataInput.readUTF());
        Assert.assertEquals(Math.abs(i), dataInput.readVInt());
        Assert.assertEquals(Math.abs(l), dataInput.readVLong());
    }
View Full Code Here

Examples of org.msgpack.unpacker.BufferUnpacker.readShort()

  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeShort(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }

    @Test @Override
    public void testInteger() throws Exception {
View Full Code Here

Examples of org.msgpack.unpacker.BufferUnpacker.readShort()

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  Packer packer = msgpack.createPacker(out);
  packer.writeShort(v);
  byte[] bytes = out.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  short ret = unpacker.readShort();
  assertEquals(v, ret);
    }

    @Test @Override
    public void testInteger() throws Exception {
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.