Package org.jgroups.util

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

Related Classes of org.jgroups.util.ByteBufferOutputStream

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.