|Modifier and Type||Method and Description|
Returns a byte array containing the remaining bytes in the given
public static final ByteBuffer EMPTY_BUFFER
public static void writeToStream(ByteBuffer buffer, OutputStream outputStream) throws IOException
OutputStream. The position and limit of the buffer is not modified after this call returns.
public static ByteBuffer copy(ByteBuffer buffer)
ByteBufferwhich the content the same as the given
ByteBufferby copying the content. The new
ByteBufferwill have position = 0, limit = content length. The returning
ByteBufferwill always be heap based buffer. The position and limit of the original buffer will not be modified after this call.
public static byte getByteArray(ByteBuffer buffer)
ByteBuffer. If the
ByteBufferis backed by array (
true) and the array is the same as remaining bytes, the underlying array will be returned without copying. Otherwise, the remaining bytes will be copied into a new array.
Copyright © 2018 Cask Data, Inc.. All rights reserved.