public class NativeBytesStore<Underlying> extends Object implements BytesStore<NativeBytesStore<Underlying>,Underlying>
| Modifier and Type | Field and Description |
|---|---|
protected long |
address |
protected net.openhft.chronicle.core.Memory |
memory |
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() |
VanillaBytes<Underlying> |
bytesForWrite() |
long |
capacity() |
void |
checkReleased() |
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, release, releaseAll, tryReservechars, codePoints@Nullable protected net.openhft.chronicle.core.Memory memory
protected long address
public NativeBytesStore(long address,
long maximumLimit,
@Nullable
Runnable deallocator,
boolean elastic)
@NotNull public static NativeBytesStore<ByteBuffer> wrap(@NotNull ByteBuffer bb)
wrap in interface BytesStore<NativeBytesStore<Underlying>,Underlying>@NotNull public static NativeBytesStore<Void> nativeStore(long capacity)
capacity - of the buffer.@NotNull public static NativeBytesStore<Void> nativeStoreWithFixedCapacity(long capacity)
@NotNull public static NativeBytesStore<Void> lazyNativeBytesStoreWithFixedCapacity(long capacity)
@NotNull public static NativeBytesStore<ByteBuffer> elasticByteBuffer()
@NotNull public static NativeBytesStore<ByteBuffer> elasticByteBuffer(int size)
@NotNull public BytesStore<NativeBytesStore<Underlying>,Underlying> copy()
copy in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public VanillaBytes<Underlying> bytesForWrite()
bytesForWrite in interface BytesStore<NativeBytesStore<Underlying>,Underlying>public long realCapacity()
realCapacity in interface BytesStore<NativeBytesStore<Underlying>,Underlying>realCapacity in interface RandomDataInputpublic long capacity()
capacity in interface BytesStore<NativeBytesStore<Underlying>,Underlying>@Nullable public Underlying underlyingObject()
underlyingObject in interface BytesStore<NativeBytesStore<Underlying>,Underlying>@NotNull 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 void checkReleased()
public 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 RandomDataInput@NotNull public NativeBytesStore<Underlying> writeByte(long offset, byte i8)
writeByte in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeShort(long offset, short i16)
writeShort in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeInt(long offset, int i32)
writeInt in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeOrderedInt(long offset, int i)
writeOrderedInt in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeLong(long offset, long i64)
writeLong in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeOrderedLong(long offset, long i)
writeOrderedLong in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeFloat(long offset, float f)
writeFloat in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> writeDouble(long offset, double d)
writeDouble in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length)
write in interface RandomDataOutput<NativeBytesStore<Underlying>>public void write(long offsetInRDO,
@NotNull
ByteBuffer bytes,
int offset,
int length)
write in interface RandomDataOutput<NativeBytesStore<Underlying>>@NotNull public NativeBytesStore<Underlying> write(long offsetInRDO, @NotNull 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 heap@NotNull public 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.