Examples of readShort()


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

        try
        {
            JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
            bm.writeShort((short)4);
            bm.reset();
            bm.readShort();
            // should throw
            bm.readShort();
            fail("expected exception did not occur");
        }
        catch (MessageEOFException m)
View Full Code Here

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

        assertTrue(!bm.readBoolean());
        assertEquals((byte)2, bm.readByte());
        byte[] bytes = new byte[4];
        bm.readBytes(bytes);
        assertEquals('g', bm.readChar());
        assertEquals((short) 29, bm.readShort());
        assertEquals(101, bm.readInt());
        assertEquals(50003222L, bm.readLong());
        assertEquals("Foobar", bm.readString());
        assertEquals(1.7f, bm.readFloat());
        assertEquals(8.7d, bm.readDouble());
View Full Code Here

Examples of org.apache.qpid.proton.TestDecoder.readShort()

        TestDecoder d = createDecoder(getBytes("primitives"));
        assertEquals(true, d.readBoolean());
        assertEquals(false, d.readBoolean());
        assertEquals(d.readUnsignedByte().intValue(), 42);
        assertEquals(42, d.readUnsignedShort().intValue());
        assertEquals(-42, d.readShort().intValue());
        assertEquals(12345, d.readUnsignedInteger().intValue());
        assertEquals(-12345, d.readInteger().intValue());
        assertEquals(12345, d.readUnsignedLong().longValue());
        assertEquals(-12345, d.readLong().longValue());
        assertEquals(0.125, d.readFloat().floatValue(), 0e-10);
View Full Code Here

Examples of org.apache.xindice.xml.XMLCompressedInput.readShort()

      if ( element ) {
         in.readSignature();
         in.readContentSize();

         short elemSymbol = in.readShort();
         elemName = symbols.getName(elemSymbol);
         localName = getLocalName(elemName);
         nsURI = symbols.getNamespaceURI(elemSymbol);
         int attrCount = in.readAttributeCount();
         AttributesImpl attrs = new AttributesImpl();
View Full Code Here

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

  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.readShort()

      assertTrue(msg.readByte()==testByte);
      msg.clearBody();
      short testShort = 3;
      msg.writeString(new Short(testShort).toString());
      msg.reset();
      assertTrue(msg.readShort()==testShort);
      msg.clearBody();
      int testInt = 4;
      msg.writeString(new Integer(testInt).toString());
      msg.reset();
      assertTrue(msg.readInt()==testInt);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamInput.readShort()

        out.writeUTF("goodbye");

        BytesStreamInput in = new BytesStreamInput(out.copiedByteArray());
        assertThat(in.readBoolean(), equalTo(false));
        assertThat(in.readByte(), equalTo((byte) 1));
        assertThat(in.readShort(), equalTo((short) -1));
        assertThat(in.readInt(), equalTo(-1));
        assertThat(in.readVInt(), equalTo(2));
        assertThat(in.readLong(), equalTo((long) -3));
        assertThat(in.readVLong(), equalTo((long) 4));
        assertThat((double) in.readFloat(), closeTo(1.1, 0.0001));
View Full Code Here

Examples of org.exist.storage.io.VariableByteInput.readShort()

        VariableByteInput mockIs = EasyMock.createMock(VariableByteInput.class);

        /* readLegacy expectations */

        //max and nsMax
        expect(mockIs.readShort()).andReturn((short)1);
        expect(mockIs.readShort()).andReturn((short)1);

        //localnames
        expect(mockIs.readInt()).andReturn(1);
        expect(mockIs.readUTF()).andReturn("local-name");
View Full Code Here

Examples of org.fusesource.hawtbuf.DataByteArrayInputStream.readShort()

        header(frame.header());

        DataByteArrayInputStream is = new DataByteArrayInputStream(frame.buffers[0]);
        QoS qos = qos();
        if(qos != QoS.AT_MOST_ONCE) {
            messageId = is.readShort();
        }
        ArrayList<Topic> list = new ArrayList<Topic>();
        while(is.available() > 0) {
            Topic topic = new Topic(MessageSupport.readUTF(is), QoS.values()[is.readByte()]);
            list.add(topic);
View Full Code Here

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

      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeByte(value);
      message.reset();

      Assert.assertEquals(value, message.readShort());
   }

   public void testReadShortFromShort() throws Exception
   {
      short value = RandomUtil.randomShort();
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.