Examples of writeShort()


Examples of org.apache.poi.util.LittleEndianByteArrayOutputStream.writeShort()

    @Test
    public void extRstEqualsAndHashCode() {
        byte buf[] = new byte[200];
        LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(buf, 0);
        String str = "\u1d02\u1d12\u1d22";
        bos.writeShort(1);
        bos.writeShort(5*LittleEndianConsts.SHORT_SIZE+str.length()*2+3*LittleEndianConsts.SHORT_SIZE+2); // data size
        bos.writeShort(0x4711);
        bos.writeShort(0x0815);
        bos.writeShort(1);
        bos.writeShort(str.length());
View Full Code Here

Examples of org.apache.poi.util.LittleEndianOutputStream.writeShort()

        case parsed: {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            LittleEndianOutputStream leos = new LittleEndianOutputStream(bos);
            // total size, will be determined later ..

            leos.writeShort(getFlags1());
            leos.write(getLabel().getBytes(ISO1));
            leos.write(0);
            leos.write(getFileName().getBytes(ISO1));
            leos.write(0);
            leos.writeShort(getFlags2());
View Full Code Here

Examples of org.apache.qpid.client.message.JMSBytesMessage.writeShort()

    public void testEOFShort() throws Exception
    {
        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeShort((short)4);
            bm.reset();
            bm.readShort();
            // should throw
            bm.readShort();
            fail("expected exception did not occur");
View Full Code Here

Examples of org.apache.qpid.client.message.JMSStreamMessage.writeShort()

    public void testEOFShort() throws Exception
    {
        try
        {
            JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
            bm.writeShort((short)4);
            bm.reset();
            bm.readShort();
            // should throw
            bm.readShort();
            fail("expected exception did not occur");
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessage.writeShort()

    }
  }
  public void testReadShort() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeShort((short) 3000);
      msg.reset();
      assertTrue(msg.readShort() == 3000);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.writeShort()

      msg.reset();
      assertTrue(((Byte)msg.readObject()).byteValue()==testByte);
      msg.clearBody();
     
      short testShort = 3;
      msg.writeShort(testShort);
      msg.reset();
      assertTrue(((Short)msg.readObject()).shortValue()==testShort);
      msg.clearBody();
     
      int testInt = 4;
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.writeShort()

    @Test public void testSimpleStreams() throws Exception {
        BytesStreamOutput out = CachedStreamOutput.popEntry().cachedBytes();
        out.writeBoolean(false);
        out.writeByte((byte) 1);
        out.writeShort((short) -1);
        out.writeInt(-1);
        out.writeVInt(2);
        out.writeLong(-3);
        out.writeVLong(4);
        out.writeFloat(1.1f);
View Full Code Here

Examples of org.elasticsearch.common.netty.buffer.ChannelBuffer.writeShort()

                } else if (opcode == 0x0A || opcode == 0x10) { // NOOP or STATS
                    // TODO once we support setQ we need to wait for them to flush
                    ChannelBuffer writeBuffer = ChannelBuffers.dynamicBuffer(24);
                    writeBuffer.writeByte(0x81)// magic
                    writeBuffer.writeByte(opcode); // opcode
                    writeBuffer.writeShort(0); // key length
                    writeBuffer.writeByte(0); // extra length = flags + expiry
                    writeBuffer.writeByte(0); // data type unused
                    writeBuffer.writeShort(0x0000); // OK
                    writeBuffer.writeInt(0); // data length
                    writeBuffer.writeInt(opaque); // opaque
View Full Code Here

Examples of org.fusesource.hawtbuf.DataByteArrayOutputStream.writeShort()

    public MQTTFrame encode() {
        try {
            DataByteArrayOutputStream os = new DataByteArrayOutputStream();
            QoS qos = qos();
            if(qos != QoS.AT_MOST_ONCE) {
                os.writeShort(messageId);
            }
            for(Topic topic: topics) {
                MessageSupport.writeUTF(os, topic.name());
                os.writeByte(topic.qos().ordinal());
            }
View Full Code Here

Examples of org.hornetq.jms.client.HornetQStreamMessage.writeShort()

   public void testReadShortFromShort() throws Exception
   {
      short value = RandomUtil.randomShort();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeShort(value);
      message.reset();

      Assert.assertEquals(value, message.readShort());
   }
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.