public ByteBuffer sliceAsByteBuffer ( int index , int length ) { if ( hasArray ( ) ) { return ByteBuffer . wrap ( ( byte [ ] ) base , ( int ) ( ( address - ARRAY_BYTE_BASE_OFFSET ) + index ) , length ) ; } else { assert ( ! isUniversalBuffer ) ; return DirectBufferAccess . newByteBuffer ( address , index , length , reference ) ; } }
Create a ByteBuffer view of the range [ index index + length ) of this memory