org.apache.commons.io

## Class ByteBuffers

- java.lang.Object
- - org.apache.commons.io.ByteBuffers

-     public final class ByteBuffers
      extends Object

  Manufactures `ByteBuffer` instances.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ByteBuffer` | `littleEndian(byte[] array)` Allocates a new byte buffer with little-endian byte order.
    `static ByteBuffer` | `littleEndian(ByteBuffer allocate)` Sets the give buffer to little-endian.
    `static ByteBuffer` | `littleEndian(int capacity)` Allocates a new byte buffer with little-endian byte order.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### littleEndian

          public static ByteBuffer littleEndian(byte[] array)

      Allocates a new byte buffer with little-endian byte order. The bytes of a multibyte value are ordered from least significant to most significant.

      The new buffer's position is zero, the limit is its capacity, the mark is undefined, and each of element is initialized to zero. The new buffer has the given backing `array`, and its `array offset` is zero.

      Parameters:
        `array` - The array that will back the new byte buffer.
      Returns:
        The new byte buffer.

    - #### littleEndian

          public static ByteBuffer littleEndian(ByteBuffer allocate)

      Sets the give buffer to little-endian.
      Parameters:
        `allocate` - The buffer to set to little-endian.
      Returns:
        the given buffer.

    - #### littleEndian

          public static ByteBuffer littleEndian(int capacity)

      Allocates a new byte buffer with little-endian byte order. The bytes of a multibyte value are ordered from least significant to most significant.

      The new buffer's position is zero, the limit is its capacity, the mark is undefined, and each of element is initialized to zero. The new buffer has a `backing array`, and its `array offset` is zero.

      Parameters:
        `capacity` - The new buffer's capacity, in bytes.
      Returns:
        The new byte buffer.
      Throws:
        `IllegalArgumentException` - If the `capacity` is negative.