Class ActiveMQBuffers

java.lang.Object
org.apache.activemq.artemis.api.core.ActiveMQBuffers

public final class ActiveMQBuffers extends Object
Factory class to create instances of ActiveMQBuffer.
  • Method Details

    • 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