Examples of readByte()


Examples of net.timewalker.ffmq3.common.message.BytesMessageImpl.readByte()

   
    // Byte
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
    assertEquals(1,msg.readByte());
   
    // Short
    msg = new BytesMessageImpl();
    msg.writeBytes(dummy);
    msg.reset();
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.StreamMessageImpl.readByte()

   
    // Byte
    msg = new StreamMessageImpl();
    msg.writeBoolean(true);
    msg.markAsReadOnly();
    try { msg.readByte(); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */  }
    assertTrue(msg.readBoolean());
   
    // Short
    msg = new StreamMessageImpl();
    msg.writeBoolean(true);
View Full Code Here

Examples of net.timewalker.ffmq3.utils.RawDataBuffer.readByte()

     * Unserialize a message
     */
    public static AbstractMessage unserialize( byte[] rawData , boolean asInternalCopy )
    {
      RawDataBuffer rawIn = new RawDataBuffer(rawData);
        byte type = rawIn.readByte();
        AbstractMessage message = MessageType.createInstance(type);
        message.initializeFromRaw(rawIn);
        if (asInternalCopy)
          message.setInternalCopy(true);
       
View Full Code Here

Examples of net.tomp2p.storage.AlternativeCompositeByteBuf.readByte()

    }
    cbuf.writeByte(1);

    byte[] me = new byte[len];
    cbuf.readBytes(me);
    cbuf.readByte();

    System.err.println("reader: " + cbuf.readerIndex());
    System.err.println("writer: " + cbuf.writerIndex());
    System.err.println("capacity: " + cbuf.capacity());
    // see https://github.com/netty/netty/issues/1976
View Full Code Here

Examples of org.activeio.PacketData.readByte()

            if (!headerLoaded) {
                headerLoaded = packet.remaining() >= HEADER_LENGTH;
                if( headerLoaded ) {
                    PacketData data = new PacketData(packet.duplicate());
                    data.readByte();
                    upPacketLength = data.readInt();
                    if( upPacketLength < 0 ) {
                        throw new IOException("Up packet lenth was invalid: "+upPacketLength);
                    }
                    upPacketLength+=HEADER_LENGTH;
View Full Code Here

Examples of org.activemq.message.ActiveMQBytesMessage.readByte()

  public void testReadByte() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeByte((byte) 2);
      msg.reset();
      assertTrue(msg.readByte() == 2);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

Examples of org.activemq.message.ActiveMQStreamMessage.readByte()

    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    try {
      byte test = (byte)4;
      msg.writeByte(test);
      msg.reset();
      assertTrue(msg.readByte()==test);
      msg.reset();
      assertTrue(msg.readShort()==test);
      msg.reset();
      assertTrue(msg.readInt()==test);
      msg.reset();
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBytesMessage.readByte()

    public void testReadByte() {
        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
        try {
            msg.writeByte((byte) 2);
            msg.reset();
            assertTrue(msg.readByte() == 2);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQStreamMessage.readByte()

            assertTrue(msg.readBoolean());
            msg.reset();
            assertTrue(msg.readString().equals("true"));
            msg.reset();
            try {
                msg.readByte();
                fail("Should have thrown exception");
            } catch (MessageFormatException mfe) {
            }
            msg.reset();
            try {
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream.readByte()

       os.writeByte(expected.type().getNumber());
       expected.writeFramed(os);
       ByteSequence seq = os.toByteSequence();

       DataByteArrayInputStream is = new DataByteArrayInputStream(seq);
       KahaEntryType type = KahaEntryType.valueOf(is.readByte());
       JournalCommand message = (JournalCommand)type.createMessage();
       message.mergeFramed(is);

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