public class NativeBytesStore<Underlying> extends Object implements BytesStore<NativeBytesStore<Underlying>,Underlying>
| Modifier and Type | Field and Description |
|---|---|
protected long |
address |
charToString| Constructor and Description |
|---|
NativeBytesStore(long address,
long maximumLimit,
Runnable deallocator,
boolean elastic) |
| Modifier and Type | Method and Description |
|---|---|
long |
address(long offset)
Obtain the underlying address.
|
default ByteOrder |
byteOrder() |
Bytes<Underlying> |
bytesForWrite() |
long |
capacity() |
boolean |
compareAndSwapInt(long offset,
int expected,
int value) |
boolean |
compareAndSwapLong(long offset,
long expected,
long value) |
BytesStore<NativeBytesStore<Underlying>,Underlying> |
copy() |
static NativeBytesStore<ByteBuffer> |
elasticByteBuffer() |
static NativeBytesStore<ByteBuffer> |
elasticByteBuffer(int size) |
boolean |
equals(Object obj) |
static NativeBytesStore<Void> |
lazyNativeBytesStoreWithFixedCapacity(long capacity) |
void |
nativeRead(long position,
long address,
long size)
expert level method for copying data to native memory.
|
static NativeBytesStore<Void> |
nativeStore(long capacity)
this is an elastic native store
|
static NativeBytesStore<Void> |
nativeStoreWithFixedCapacity(long capacity) |
void |
nativeWrite(long address,
long position,
long size)
expert level method to copy data from native memory into the BytesStore
|
byte |
readByte(long offset) |
double |
readDouble(long offset) |
float |
readFloat(long offset) |
long |
readIncompleteLong(long offset) |
int |
readInt(long offset) |
default long |
readLimit() |
long |
readLong(long offset) |
default long |
readPosition() |
default long |
readRemaining() |
short |
readShort(long offset) |
int |
readVolatileInt(long offset) |
long |
readVolatileLong(long offset) |
long |
realCapacity() |
long |
refCount() |
void |
release() |
void |
reserve() |
void |
setAddress(long address) |
default long |
start() |
String |
toString() |
Underlying |
underlyingObject() |
static NativeBytesStore<ByteBuffer> |
wrap(ByteBuffer bb) |
NativeBytesStore<Underlying> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length) |
NativeBytesStore<Underlying> |
write(long offsetInRDO,
RandomDataInput bytes,
long offset,
long length) |
NativeBytesStore<Underlying> |
writeByte(long offset,
byte i8) |
NativeBytesStore<Underlying> |
writeDouble(long offset,
double d) |
NativeBytesStore<Underlying> |
writeFloat(long offset,
float f) |
NativeBytesStore<Underlying> |
writeInt(long offset,
int i32) |
default long |
writeLimit() |
NativeBytesStore<Underlying> |
writeLong(long offset,
long i64) |
NativeBytesStore<Underlying> |
writeOrderedInt(long offset,
int i) |
NativeBytesStore<Underlying> |
writeOrderedLong(long offset,
long i) |
default long |
writePosition() |
default long |
writeRemaining() |
NativeBytesStore<Underlying> |
writeShort(long offset,
short i16) |
NativeBytesStore<Underlying> |
zeroOut(long start,
long end) |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAndGetInt, addAndGetLong, byteCheckSum, bytesForRead, bytesStore, charAt, copyTo, equalBytes, getAndAddInt, inside, isClear, length, nativePointer, safeLimit, subSequence, toDebugString, wrapbytesEqual, copyTo, createCharToString, parseLong, printable, readBoolean, readUnsignedByte, readUnsignedInt, readUnsignedShortappend, write, write, writeBoolean, writeByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedShortclose, releaseAll, tryReservechars, codePointspublic NativeBytesStore(long address,
long maximumLimit,
Runnable deallocator,
boolean elastic)
public static NativeBytesStore<ByteBuffer> wrap(ByteBuffer bb)
wrap in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public static NativeBytesStore<Void> nativeStore(long capacity)
capacity - of the buffer.public static NativeBytesStore<Void> nativeStoreWithFixedCapacity(long capacity)
public static NativeBytesStore<Void> lazyNativeBytesStoreWithFixedCapacity(long capacity)
public static NativeBytesStore<ByteBuffer> elasticByteBuffer()
public static NativeBytesStore<ByteBuffer> elasticByteBuffer(int size)
public BytesStore<NativeBytesStore<Underlying>,Underlying> copy()
copy in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public Bytes<Underlying> bytesForWrite()
bytesForWrite in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public long realCapacity()
realCapacity in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public long capacity()
capacity in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public Underlying underlyingObject()
underlyingObject in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public NativeBytesStore<Underlying> zeroOut(long start, long end)
zeroOut in interface BytesStore<NativeBytesStore<Underlying>,Underlying>zeroOut in interface RandomDataOutput<NativeBytesStore<Underlying>>public boolean compareAndSwapInt(long offset,
int expected,
int value)
compareAndSwapInt in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public boolean compareAndSwapLong(long offset,
long expected,
long value)
compareAndSwapLong in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public void reserve()
reserve in interface net.openhft.chronicle.core.ReferenceCountedpublic void release()
release in interface net.openhft.chronicle.core.ReferenceCountedpublic long refCount()
refCount in interface net.openhft.chronicle.core.ReferenceCountedpublic byte readByte(long offset)
readByte in interface RandomDataInputpublic short readShort(long offset)
readShort in interface RandomDataInputpublic int readInt(long offset)
readInt in interface RandomDataInputpublic long readLong(long offset)
readLong in interface RandomDataInputpublic float readFloat(long offset)
readFloat in interface RandomDataInputpublic double readDouble(long offset)
readDouble in interface RandomDataInputpublic int readVolatileInt(long offset)
readVolatileInt in interface RandomDataInputpublic long readVolatileLong(long offset)
readVolatileLong in interface RandomDataInputpublic NativeBytesStore<Underlying> writeByte(long offset, byte i8)
writeByte in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeShort(long offset, short i16)
writeShort in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeInt(long offset, int i32)
writeInt in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeOrderedInt(long offset, int i)
writeOrderedInt in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeLong(long offset, long i64)
writeLong in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeOrderedLong(long offset, long i)
writeOrderedLong in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeFloat(long offset, float f)
writeFloat in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> writeDouble(long offset, double d)
writeDouble in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length)
write in interface RandomDataOutput<NativeBytesStore<Underlying>>public void write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length)
write in interface RandomDataOutput<NativeBytesStore<Underlying>>public NativeBytesStore<Underlying> write(long offsetInRDO, RandomDataInput bytes, long offset, long length)
write in interface RandomDataOutput<NativeBytesStore<Underlying>>public long address(long offset)
throws UnsupportedOperationException
offset - within this buffer. address(start()) is the actual address of the first byte.UnsupportedOperationException - if the underlying buffer is on the heappublic String toString()
toString in interface CharSequencetoString in class Objectpublic void nativeRead(long position,
long address,
long size)
RandomDataInputnativeRead in interface RandomDataInputposition - within the ByteStore to copy.address - in native memorysize - in bytespublic void nativeWrite(long address,
long position,
long size)
RandomDataOutputnativeWrite in interface RandomDataOutput<NativeBytesStore<Underlying>>address - in native memory to copy fromposition - in BytesStore to copy tosize - in bytespublic long readIncompleteLong(long offset)
readIncompleteLong in interface RandomDataInputpublic void setAddress(long address)
public long start()
public long readPosition()
public long writePosition()
public long readRemaining()
public long writeRemaining()
public long readLimit()
public long writeLimit()
public ByteOrder byteOrder()
Copyright © 2015. All rights reserved.