public class DirectSlice extends AbstractSlice<java.nio.ByteBuffer>
ByteBuffer backed slices typically perform better with larger keys and values. When using smaller keys and values consider using @see org.rocksdb.Slice
| 限定符和类型 | 字段和说明 |
|---|---|
static DirectSlice |
NONE |
| 构造器和说明 |
|---|
DirectSlice(java.nio.ByteBuffer data)
Constructs a slice where the data is
read from the provided
ByteBuffer
|
DirectSlice(java.nio.ByteBuffer data,
int length)
Constructs a slice where the data is
read from the provided
ByteBuffer up to a certain length
|
DirectSlice(java.lang.String str)
Constructs a slice
where the data is taken from
a String.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clears the backing slice
|
protected java.nio.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(java.lang.String str)
str - The stringpublic DirectSlice(java.nio.ByteBuffer data,
int length)
data - The buffer containing the datalength - The length of the data to use for the slicepublic DirectSlice(java.nio.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 在类中 AbstractSlice<java.nio.ByteBuffer>public void removePrefix(int n)
AbstractSlicen
number of bytes from the start
of the backing sliceremovePrefix 在类中 AbstractSlice<java.nio.ByteBuffer>n - The number of bytes to droppublic void setLength(int n)
protected void disposeInternal()
disposeInternal 在类中 RocksMutableObjectprotected final java.nio.ByteBuffer data0(long handle)
AbstractSlicedata0 在类中 AbstractSlice<java.nio.ByteBuffer>handle - The address of the underlying
native object.