src/test/java/pityoulish/sockets/client/TLVRequestBuilderImplTest.java
public static byte[] toBytes(ByteBuffer buffer)
  {
    assertNotNull("no ByteBuffer", buffer);

    int length = buffer.remaining();
    byte[] data = new byte[length];
    buffer.get(data);

    return data;
  }
/**
   * Obtains the data from a ByteBuffer as an array.
   * This modifies the position of the buffer.
   *
   * @param buffer   the buffer to read from
   *
   * @return the data read from the buffer
   */
Obtains the data from a ByteBuffer as an array.
This modifies the position of the buffer.

@param buffer   the buffer to read from

@return the data read from the buffer
Obtains the data from a ByteBuffer as an array . This modifies the position of the buffer . @param buffer the buffer to read from @return the data read from the buffer
public static byte[] toBytes(ByteBuffer buffer)
  {
    assertNotNull("no ByteBuffer", buffer);
    int length = buffer.remaining();
    byte[] data = new byte[length];
    buffer.get(data);
    return data;
  }
public static byte [ ] toBytes ( ByteBuffer buffer ) { assertNotNull ( "no ByteBuffer" , buffer ) ; int length = buffer . remaining ( ) ; byte [ ] data = new byte [ length ] ; buffer . get ( data ) ; return data ; }
Obtains the data from a ByteBuffer as an array.
Obtains the data from a ByteBuffer as an array .