Package org.jboss.soa.esb.message.body.content

Examples of org.jboss.soa.esb.message.body.content.BytesBody


  {
    Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);

    assertEquals((msg != null), true);

    BytesBody mapMessage = Payload.createBytesBody(msg);

    try
    {
      mapMessage.readMode();
     
      fail();
    }
    catch (Exception ex)
    {
    }
   
    try
    {
      mapMessage.writeBoolean(true);

      fail();
    }
    catch (IncompatibleModeException ex)
    {
    }

    mapMessage.writeMode();

    mapMessage.writeInt(12345);
    mapMessage.writeUTFString("hello world");
    mapMessage.writeShort((short) 10);
    mapMessage.writeBoolean(true);

    mapMessage.flush();
   
    mapMessage.readMode();

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


   
    assertEquals(input.readInt(), 12345);
    assertEquals(input.readUTF(), "Hello World");
   
    Message msg = _factory.createBytesMessage(stream.toByteArray());
    BytesBody body = (BytesBody) msg.getBody();
   
    body.readMode();
   
    assertEquals(body.readInt(), 12345);
    assertEquals(body.readUTFString(), "Hello World");
  }
View Full Code Here

   
    assertEquals(input.readInt(), 12345);
    assertEquals(input.readUTF(), "Hello World");
   
    Message msg = _factory.createBytesMessage(stream.toByteArray());
    BytesBody body = (BytesBody) msg.getBody();
   
    body.readMode();
   
    assertEquals(body.readInt(), 12345);
    assertEquals(body.readUTFString(), "Hello World");
  }
View Full Code Here

   
    Message msg = MessageFactory.getInstance().getMessage(_type);
   
    try
    {
      BytesBody payload = (BytesBody) MessageFactory.getInstance().createBodyType(msg, Payload.BYTES_BODY);
     
      payload.add(BytesBody.BYTES_LOCATION, initial);
     
      return msg;
    }
    catch (Exception ex)
    {
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.message.body.content.BytesBody

Copyright © 2018 www.massapicom. 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.