public class DirectSlice extends AbstractSlice<ByteBuffer>
| Modifier and Type | Field and Description |
|---|---|
static DirectSlice |
NONE |
| Constructor and Description |
|---|
DirectSlice(ByteBuffer data)
Constructs a slice where the data is
read from the provided
ByteBuffer
|
DirectSlice(ByteBuffer data,
int length)
Constructs a slice where the data is
read from the provided
ByteBuffer up to a certain length
|
DirectSlice(String str)
Constructs a slice
where the data is taken from
a String.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the backing slice
|
protected ByteBuffer |
data0(long handle)
Access to the data is provided by the
subtype as it needs to handle the
generic typing.
|
protected void |
disposeInternal() |
byte |
get(int offset)
Retrieves the byte at a specific offset
from the underlying data
|
void |
removePrefix(int n)
Drops the specified
n
number of bytes from the start
of the backing slice |
void |
setLength(int n) |
compare, createNewSliceFromString, data, disposeInternal, empty, equals, hashCode, size, startsWith, toString, toStringclose, getNativeHandle, isOwningHandle, resetNativeHandle, setNativeHandlepublic static final DirectSlice NONE
public DirectSlice(String str)
str - The stringpublic DirectSlice(ByteBuffer data, int length)
data - The buffer containing the datalength - The length of the data to use for the slicepublic DirectSlice(ByteBuffer data)
data - The bugger containing the datapublic byte get(int offset)
offset - The (zero-based) offset of the byte to retrievepublic void clear()
AbstractSliceclear in class AbstractSlice<ByteBuffer>public void removePrefix(int n)
AbstractSlicen
number of bytes from the start
of the backing sliceremovePrefix in class AbstractSlice<ByteBuffer>n - The number of bytes to droppublic void setLength(int n)
protected void disposeInternal()
disposeInternal in class RocksMutableObjectprotected final ByteBuffer data0(long handle)
AbstractSlicedata0 in class AbstractSlice<ByteBuffer>handle - The address of the underlying
native object.Copyright © 2022. All rights reserved.