Examples of ByteBufferOutputStream


Examples of org.apache.mina.util.ByteBufferOutputStream

        return list;
    }

    @Override
    protected ByteBuffer delimitWithOriginal() throws IOException {
        ByteBufferOutputStream bbos = new ByteBufferOutputStream();
        bbos.setElastic(true);

        for (Person p : getObjects()) {
            p.writeDelimitedTo(bbos);
        }
        return bbos.getByteBuffer();
    }
View Full Code Here

Examples of org.apache.qpid.server.util.ByteBufferOutputStream

    public int writeToBuffer(int offsetInMetaData, ByteBuffer dest)
    {
        int oldPosition = dest.position();
        try
        {
            DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
            EncodingUtils.writeLong(dataOutputStream, _messageId);
            EncodingUtils.writeInteger(dataOutputStream, _contentSize);
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.qpid.server.util.ByteBufferOutputStream

    {
        int oldPosition = dest.position();
        try
        {

            DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
            EncodingUtils.writeInteger(dataOutputStream, _contentHeaderBody.getSize());
            _contentHeaderBody.writePayload(dataOutputStream);
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getExchange());
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getRoutingKey());
            byte flags = 0;
View Full Code Here

Examples of org.apache.qpid.server.util.ByteBufferOutputStream

    public int writeToBuffer(ByteBuffer dest)
    {
        int oldPosition = dest.position();
        try
        {
            DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
            EncodingUtils.writeLong(dataOutputStream, _messageId);
            EncodingUtils.writeInteger(dataOutputStream, _contentSize);
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.qpid.server.util.ByteBufferOutputStream

    {
        int oldPosition = dest.position();
        try
        {

            DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
            EncodingUtils.writeInteger(dataOutputStream, _contentHeaderBody.getSize());
            _contentHeaderBody.writePayload(dataOutputStream);
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getExchange());
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getRoutingKey());
            byte flags = 0;
View Full Code Here

Examples of org.apache.qpid.server.util.ByteBufferOutputStream

    {
        int oldPosition = dest.position();
        try
        {

            DataOutputStream dataOutputStream = new DataOutputStream(new ByteBufferOutputStream(dest));
            EncodingUtils.writeInteger(dataOutputStream, _contentHeaderBody.getSize());
            _contentHeaderBody.writePayload(dataOutputStream);
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getExchange());
            EncodingUtils.writeShortStringBytes(dataOutputStream, _messagePublishInfo.getRoutingKey());
            byte flags = 0;
View Full Code Here

Examples of org.commonlib.io.ByteBufferOutputStream

   * @throws Exception
   */
  public static byte[] writeObjectToBytes(Serializable toWrite)
     throws Exception
  {
    ByteBufferOutputStream fos = new ByteBufferOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    try
    {
      oos.writeObject(toWrite);
    }
    finally
    {
      oos.close();
      fos.close();
    }
    return fos.getBytes();
  }
View Full Code Here

Examples of org.jgroups.util.ByteBufferOutputStream

        Address dest=Util.createRandomAddress("A");
        Message msg=new Message(dest, "hello world")
          .setFlag(Message.Flag.DONT_BUNDLE,Message.Flag.OOB).putHeader((short)22, NakAckHeader2.createMessageHeader(322649));
        int size=(int)(msg.size());
        ByteBuffer buf=ByteBuffer.allocate(size);
        ByteBufferOutputStream out=new ByteBufferOutputStream(buf);
        msg.writeTo(out);

        buf.flip();
        byte[] array=new byte[buf.limit()];
        System.arraycopy(buf.array(), buf.arrayOffset(), array, 0, buf.limit());
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.