Class ActiveMQBuffers
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.ActiveMQBuffers
-
public final class ActiveMQBuffers extends Object
Factory class to create instances ofActiveMQBuffer
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ActiveMQBuffer
dynamicBuffer(byte[] bytes)
Creates a self-expanding ActiveMQBuffer filled with the given byte arraystatic ActiveMQBuffer
dynamicBuffer(int size)
Creates a self-expanding ActiveMQBuffer with the given initial sizestatic ActiveMQBuffer
fixedBuffer(int size)
Creates a fixed ActiveMQBuffer of the given sizestatic ActiveMQBuffer
pooledBuffer(int size)
static ActiveMQBuffer
wrappedBuffer(byte[] underlying)
Creates an ActiveMQBuffer wrapping an underlying byte arraystatic ActiveMQBuffer
wrappedBuffer(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 ActiveMQBuffer
wrappedBuffer(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 Detail
-
dynamicBuffer
public static ActiveMQBuffer dynamicBuffer(int size)
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
public static ActiveMQBuffer pooledBuffer(int size)
-
dynamicBuffer
public static ActiveMQBuffer dynamicBuffer(byte[] bytes)
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
public static ActiveMQBuffer wrappedBuffer(ByteBuffer underlying)
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
public static ActiveMQBuffer wrappedBuffer(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 buffer- Parameters:
underlying
- the underlying NIO ByteBuffer- Returns:
- an ActiveMQBuffer wrapping the underlying NIO ByteBuffer
-
wrappedBuffer
public static ActiveMQBuffer wrappedBuffer(byte[] underlying)
Creates an ActiveMQBuffer wrapping an underlying byte array- Parameters:
underlying
- the underlying byte array- Returns:
- an ActiveMQBuffer wrapping the underlying byte array
-
fixedBuffer
public static ActiveMQBuffer fixedBuffer(int size)
Creates a fixed ActiveMQBuffer of the given size- Parameters:
size
- the size of the created ActiveMQBuffer- Returns:
- a fixed ActiveMQBuffer with the given size
-
-