## org.hornetq.api.core
Class HornetQBuffers

    java.lang.Object
      org.hornetq.api.core.HornetQBuffers

    public class HornetQBuffers

extends Object

Factory class to create HornetQBuffers

Author:
  Tim Fox

Method Summary
`static HornetQBuffer` `dynamicBuffer(byte[] bytes)` Creates a self-expanding HornetQBuffer filled with the given byte array
`static HornetQBuffer` `dynamicBuffer(int size)` Creates a self-expanding HornetQBuffer with the given initial size
`static HornetQBuffer` `fixedBuffer(int size)` Creates a fixed HornetQBuffer of the given size
`static HornetQBuffer` `wrappedBuffer(byte[] underlying)` Creates a HornetQBuffer wrapping an underlying byte array
`static HornetQBuffer` `wrappedBuffer(ByteBuffer underlying)` Creates a HornetQBuffer 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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### dynamicBuffer

    public static HornetQBuffer dynamicBuffer(int size)

  Creates a self-expanding HornetQBuffer with the given initial size

  Parameters:
    `size` - the initial size of the created HornetQBuffer
  Returns:
    a self-expanding HornetQBuffer starting with the given size

### dynamicBuffer

    public static HornetQBuffer dynamicBuffer(byte[] bytes)

  Creates a self-expanding HornetQBuffer filled with the given byte array

  Parameters:
    `bytes` - the created buffer will be initially filled with this byte array
  Returns:
    a self-expanding HornetQBuffer filled with the given byte array

### wrappedBuffer

    public static HornetQBuffer wrappedBuffer(ByteBuffer underlying)

  Creates a HornetQBuffer 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:
    a HornetQBuffer wrapping the underlying NIO ByteBuffer

### wrappedBuffer

    public static HornetQBuffer wrappedBuffer(byte[] underlying)

  Creates a HornetQBuffer wrapping an underlying byte array

  Parameters:
    `underlying` - the underlying byte array
  Returns:
    a HornetQBuffer wrapping the underlying byte array

### fixedBuffer

    public static HornetQBuffer fixedBuffer(int size)

  Creates a fixed HornetQBuffer of the given size

  Parameters:
    `size` - the size of the created HornetQBuffer
  Returns:
    a fixed HornetQBuffer with the given size

Copyright © 2009 Red Hat Inc. All Rights Reserved.