Methods Summary |
---|
static java.lang.Object | getBaseArray(java.nio.Buffer b)Returns the underlying Java array containing the data of the
given Buffer, or null if the Buffer is not backed by a Java array.
return b._array();
|
static int | getBaseArrayOffset(java.nio.Buffer b)Returns the offset in bytes from the start of the underlying
Java array object containing the data of the given Buffer to
the actual start of the data. This method is only meaningful if
getBaseArray() returns non-null.
return b._arrayOffset() << b._elementSizeShift;
|
static long | getBasePointer(java.nio.Buffer b)Returns the underlying native pointer to the data of the given
Buffer starting at the Buffer's current position, or 0 if the
Buffer is not backed by native heap storage. Note that this is
different than what the Harmony implementation calls a "base
address."
if (b instanceof DirectBuffer) {
PlatformAddress address = ((DirectBuffer) b).getEffectiveAddress();
if (address == null) {
return 0L;
}
return address.toInt() + (b.position() << b._elementSizeShift);
}
return 0L;
|
static int | getRemainingBytes(java.nio.Buffer b)Returns the number of bytes remaining in the given Buffer. That is,
this scales remaining() by the byte-size of elements
of this Buffer.
return (b.limit - b.position) << b._elementSizeShift;
|