Class ActiveMQBuffers
java.lang.Object
org.apache.activemq.artemis.api.core.ActiveMQBuffers
Factory class to create instances of
ActiveMQBuffer.-
Method Summary
Modifier and TypeMethodDescriptionstatic ActiveMQBufferdynamicBuffer(byte[] bytes) Creates a self-expanding ActiveMQBuffer filled with the given byte arraystatic ActiveMQBufferdynamicBuffer(int size) Creates a self-expanding ActiveMQBuffer with the given initial sizestatic ActiveMQBufferfixedBuffer(int size) Creates a fixed ActiveMQBuffer of the given sizestatic ActiveMQBufferpooledBuffer(int size) static ActiveMQBufferwrappedBuffer(byte[] underlying) Creates an ActiveMQBuffer wrapping an underlying byte arraystatic ActiveMQBufferwrappedBuffer(io.netty.buffer.ByteBuf underlying) Creates an ActiveMQBuffer wrapping an underlying ByteBuf The position on this buffer won't affect the position on the inner bufferstatic ActiveMQBufferwrappedBuffer(ByteBuffer underlying) Creates an ActiveMQBuffer wrapping an underlying NIO ByteBuffer The position on this buffer won't affect the position on the inner buffer
-
Method Details
-
dynamicBuffer
Creates a self-expanding ActiveMQBuffer with the given initial size- Parameters:
size- the initial size of the created ActiveMQBuffer- Returns:
- a self-expanding ActiveMQBuffer starting with the given size
-
pooledBuffer
-
dynamicBuffer
Creates a self-expanding ActiveMQBuffer filled with the given byte array- Parameters:
bytes- the created buffer will be initially filled with this byte array- Returns:
- a self-expanding ActiveMQBuffer filled with the given byte array
-
wrappedBuffer
Creates an ActiveMQBuffer wrapping an underlying NIO ByteBuffer The position on this buffer won't affect the position on the inner buffer- Parameters:
underlying- the underlying NIO ByteBuffer- Returns:
- an ActiveMQBuffer wrapping the underlying NIO ByteBuffer
-
wrappedBuffer
Creates an ActiveMQBuffer wrapping an underlying ByteBuf The position on this buffer won't affect the position on the inner buffer- Parameters:
underlying- the underlying NIO ByteBuffer- Returns:
- an ActiveMQBuffer wrapping the underlying NIO ByteBuffer
-
wrappedBuffer
Creates an ActiveMQBuffer wrapping an underlying byte array- Parameters:
underlying- the underlying byte array- Returns:
- an ActiveMQBuffer wrapping the underlying byte array
-
fixedBuffer
Creates a fixed ActiveMQBuffer of the given size- Parameters:
size- the size of the created ActiveMQBuffer- Returns:
- a fixed ActiveMQBuffer with the given size
-