Class ActiveMQBuffers


  • public final class ActiveMQBuffers
    extends java.lang.Object
    Factory class to create instances of ActiveMQBuffer.
    • 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 array
      static ActiveMQBuffer dynamicBuffer​(int size)
      Creates a self-expanding ActiveMQBuffer with the given initial size
      static ActiveMQBuffer fixedBuffer​(int size)
      Creates a fixed ActiveMQBuffer of the given size
      static ActiveMQBuffer pooledBuffer​(int size)  
      static ActiveMQBuffer wrappedBuffer​(byte[] underlying)
      Creates an ActiveMQBuffer wrapping an underlying byte array
      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
      static ActiveMQBuffer wrappedBuffer​(java.nio.ByteBuffer underlying)
      Creates an ActiveMQBuffer wrapping an underlying NIO ByteBuffer The position on this buffer won't affect the position on the inner buffer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.nio.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