public abstract class SafeWritableBase extends Object implements org.apache.datasketches.memory.BaseState
ByteBuffer look like a Memory or
Buffer. All methods delegate directly to the ByteBuffer rather
than using 'unsafe' reads.SafeWritableMemory,
SafeWritableBuffer| Constructor and Description |
|---|
SafeWritableBase(ByteBuffer buffer) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkValidAndBounds(long offsetBytes,
long lengthBytes) |
boolean |
getBoolean(long offsetBytes) |
byte |
getByte(long offsetBytes) |
ByteBuffer |
getByteBuffer() |
long |
getCapacity() |
char |
getChar(long offsetBytes) |
long |
getCumulativeOffset() |
long |
getCumulativeOffset(long offsetBytes) |
double |
getDouble(long offsetBytes) |
float |
getFloat(long offsetBytes) |
int |
getInt(long offsetBytes) |
long |
getLong(long offsetBytes) |
org.apache.datasketches.memory.MemoryRequestServer |
getMemoryRequestServer() |
long |
getRegionOffset() |
long |
getRegionOffset(long offsetBytes) |
short |
getShort(long offsetBytes) |
ByteOrder |
getTypeByteOrder() |
boolean |
hasArray() |
boolean |
hasByteBuffer() |
boolean |
isByteOrderCompatible(ByteOrder byteOrder) |
boolean |
isDirect() |
boolean |
isReadOnly() |
boolean |
isSameResource(Object that) |
boolean |
isValid() |
void |
putBoolean(long offsetBytes,
boolean value) |
void |
putByte(long offsetBytes,
byte value) |
void |
putChar(long offsetBytes,
char value) |
void |
putDouble(long offsetBytes,
double value) |
void |
putFloat(long offsetBytes,
float value) |
void |
putInt(long offsetBytes,
int value) |
void |
putLong(long offsetBytes,
long value) |
void |
putShort(long offsetBytes,
short value) |
String |
toHexString(String header,
long offsetBytes,
int lengthBytes)
Adapted from
BaseStateImpl.toHexString(String, long, int) |
long |
xxHash64(long in,
long seed) |
long |
xxHash64(long offsetBytes,
long lengthBytes,
long seed) |
public SafeWritableBase(ByteBuffer buffer)
public org.apache.datasketches.memory.MemoryRequestServer getMemoryRequestServer()
public boolean getBoolean(long offsetBytes)
public byte getByte(long offsetBytes)
public char getChar(long offsetBytes)
public double getDouble(long offsetBytes)
public float getFloat(long offsetBytes)
public int getInt(long offsetBytes)
public long getLong(long offsetBytes)
public short getShort(long offsetBytes)
public void putBoolean(long offsetBytes,
boolean value)
public void putByte(long offsetBytes,
byte value)
public void putChar(long offsetBytes,
char value)
public void putDouble(long offsetBytes,
double value)
public void putFloat(long offsetBytes,
float value)
public void putInt(long offsetBytes,
int value)
public void putLong(long offsetBytes,
long value)
public void putShort(long offsetBytes,
short value)
public ByteOrder getTypeByteOrder()
getTypeByteOrder in interface org.apache.datasketches.memory.BaseStatepublic boolean isByteOrderCompatible(ByteOrder byteOrder)
isByteOrderCompatible in interface org.apache.datasketches.memory.BaseStatepublic ByteBuffer getByteBuffer()
getByteBuffer in interface org.apache.datasketches.memory.BaseStatepublic long getCapacity()
getCapacity in interface org.apache.datasketches.memory.BaseStatepublic long getCumulativeOffset()
getCumulativeOffset in interface org.apache.datasketches.memory.BaseStatepublic long getCumulativeOffset(long offsetBytes)
getCumulativeOffset in interface org.apache.datasketches.memory.BaseStatepublic long getRegionOffset()
getRegionOffset in interface org.apache.datasketches.memory.BaseStatepublic long getRegionOffset(long offsetBytes)
getRegionOffset in interface org.apache.datasketches.memory.BaseStatepublic boolean hasArray()
hasArray in interface org.apache.datasketches.memory.BaseStatepublic long xxHash64(long offsetBytes,
long lengthBytes,
long seed)
xxHash64 in interface org.apache.datasketches.memory.BaseStatepublic long xxHash64(long in,
long seed)
xxHash64 in interface org.apache.datasketches.memory.BaseStatepublic boolean hasByteBuffer()
hasByteBuffer in interface org.apache.datasketches.memory.BaseStatepublic boolean isDirect()
isDirect in interface org.apache.datasketches.memory.BaseStatepublic boolean isReadOnly()
isReadOnly in interface org.apache.datasketches.memory.BaseStatepublic boolean isSameResource(Object that)
isSameResource in interface org.apache.datasketches.memory.BaseStatepublic boolean isValid()
isValid in interface org.apache.datasketches.memory.BaseStatepublic void checkValidAndBounds(long offsetBytes,
long lengthBytes)
checkValidAndBounds in interface org.apache.datasketches.memory.BaseStateCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.