public class UncheckedNativeBytes<Underlying> extends Object implements Bytes<Underlying>
| Modifier and Type | Field and Description |
|---|---|
protected @NotNull NativeBytesStore<Underlying> |
bytesStore |
protected long |
capacity |
protected long |
readPosition |
protected long |
writeLimit |
protected long |
writePosition |
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITYcharToStringJAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16| Constructor and Description |
|---|
UncheckedNativeBytes(@NotNull Bytes<Underlying> underlyingBytes) |
| Modifier and Type | Method and Description |
|---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
default long |
addressForRead(long offset,
int buffer) |
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWritePosition() |
@NotNull Bytes<Underlying> |
append8bit(@NotNull CharSequence cs)
Append a String to the Bytes in ISO-8859-1
|
@NotNull Bytes<Underlying> |
appendUtf8(char[] chars,
int offset,
int length) |
int |
byteCheckSum()
Return the bytes sum of the readable bytes.
|
default ByteOrder |
byteOrder() |
@Nullable BytesStore |
bytesStore() |
long |
capacity() |
boolean |
checkRefCount() |
@NotNull Bytes<Underlying> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
@NotNull Bytes<Underlying> |
clearAndPad(long length)
Clear a buffer, with a given padding to allow for prepending later.
|
@NotNull Bytes<Underlying> |
compact()
Compact these Bytes by moving the readPosition to the start.
|
default boolean |
compareAndSwapDouble(long offset,
double expected,
double value)
Perform a 64-bit double CAS at a given offset.
|
default boolean |
compareAndSwapFloat(long offset,
float expected,
float value)
Perform a 32-bit float CAS at a given offset.
|
boolean |
compareAndSwapInt(long offset,
int expected,
int value)
Perform a 32-bit CAS at a given offset.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
@NotNull BytesStore<Bytes<Underlying>,Underlying> |
copy() |
void |
ensureCapacity(long size)
grow the buffer if the buffer is elastic, if the buffer is not elastic and there is not
enough capacity then this method will throws
BufferOverflowException |
boolean |
equals(Object obj) |
boolean |
equalsBytes(@NotNull Bytes b2,
long remaining) |
int |
hashCode() |
boolean |
isDirectMemory() |
boolean |
isElastic()
Returns if this Bytes is elastic.
|
int |
lastDecimalPlaces() |
void |
lastDecimalPlaces(int lastDecimalPlaces)
Store the last number of decimal places.
|
boolean |
lenient() |
void |
lenient(boolean lenient)
When there is no more data to read, return zero, false and empty string.
|
void |
move(long from,
long to,
long length) |
void |
nativeRead(long address,
long size)
This is an expert level method for copying raw native memory in bulk.
|
void |
nativeRead(long position,
long address,
long size)
expert level method for copying data to native memory.
|
void |
nativeWrite(long address,
long size)
This is an expert level method for writing out data to native memory.
|
void |
nativeWrite(long address,
long position,
long size)
expert level method to copy data from native memory into the BytesStore
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Bytes buffer,
@NotNull StopCharsTester stopCharsTester) |
default String |
parse8bit(@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(StringBuilder buffer,
@NotNull StopCharsTester stopCharsTester) |
default @NotNull BigDecimal |
parseBigDecimal() |
default @Nullable Boolean |
parseBoolean() |
default @Nullable Boolean |
parseBoolean(@NotNull StopCharTester tester)
Return true or false, or null if it could not be detected
as true or false.
|
default double |
parseDouble()
parse text as a double decimal.
|
default float |
parseFloat()
parse text as a float decimal.
|
default int |
parseInt()
parse text as an int.
|
default long |
parseLong()
parse text as a long integer.
|
default long |
parseLongDecimal()
Parse the significant digits of a decimal number.
|
default void |
parseUTF(@NotNull Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
Deprecated.
|
default void |
parseUTF(@NotNull Appendable buffer,
@NotNull StopCharTester stopCharTester)
Deprecated.
|
default @NotNull String |
parseUTF(@NotNull StopCharTester stopCharTester)
Deprecated.
|
default void |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default @NotNull String |
parseUtf8(@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
int |
peekUnsignedByte() |
int |
peekUnsignedByte(long offset)
Read an unsigned byte at an offset, or -1
|
@NotNull Bytes<Underlying> |
prewrite(@NotNull byte[] bytes)
Write backward in binary a byte
|
@NotNull Bytes<Underlying> |
prewrite(@NotNull BytesStore bytes)
Write backward in binary a byte
|
@NotNull Bytes<Underlying> |
prewriteByte(byte i8)
Write backward in binary a byte
|
@NotNull Bytes<Underlying> |
prewriteInt(int i)
Write backward in binary a 4 byte int
|
@NotNull Bytes<Underlying> |
prewriteLong(long i64)
Write backward in binary an 8 byte long
|
protected long |
prewriteOffsetPositionMoved(long substracting) |
@NotNull Bytes<Underlying> |
prewriteShort(short i16)
Write backward in binary a 2 byte int
|
long |
rawCopy(@NotNull RandomDataInput bytes,
long offset,
long length) |
byte |
readByte() |
byte |
readByte(long offset)
Read byte at an offset
|
double |
readDouble() |
double |
readDouble(long offset)
Read a double at an offset
|
default @NotNull Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
float |
readFloat() |
float |
readFloat(long offset)
Read a float at an offset
|
int |
readInt() |
int |
readInt(long offset)
Read an int at an offset
|
long |
readLimit() |
@NotNull Bytes<Underlying> |
readLimit(long limit) |
long |
readLong() |
long |
readLong(long offset)
Read a long at an offset
|
protected long |
readOffsetPositionMoved(long adding) |
long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
@NotNull Bytes<Underlying> |
readPosition(long position) |
default long |
readRemaining() |
short |
readShort() |
short |
readShort(long offset)
Read a short at an offset
|
@NotNull Bytes<Underlying> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
int |
readUnsignedByte() |
int |
readUnsignedByte(long offset)
Read an unsigned byte at an offset
|
byte |
readVolatileByte(long offset)
Read a 8-bit byte from memory with a load barrier.
|
int |
readVolatileInt() |
int |
readVolatileInt(long offset)
Read a 32-bit int from memory with a load barrier.
|
long |
readVolatileLong() |
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
short |
readVolatileShort(long offset)
Read a 16-bit short from memory with a load barrier.
|
long |
realCapacity()
Returns the actual capacity that can be potentially read.
|
long |
realWriteRemaining() |
long |
refCount() |
void |
release() |
void |
reserve() |
default boolean |
skipTo(@NotNull StopCharTester tester)
Skip text until a terminating character is reached.
|
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
@NotNull String |
toString() |
boolean |
tryReserve() |
boolean |
unchecked() |
@NotNull Bytes<Underlying> |
unchecked(boolean unchecked)
Return a Bytes which is optionally unchecked.
|
void |
uncheckedReadSkipBackOne()
Read skip -1 when you are sure this is safe.
|
void |
uncheckedReadSkipOne()
Read skip 1 when you are sure this is safe.
|
int |
uncheckedReadUnsignedByte() |
Underlying |
underlyingObject() |
@NotNull Bytes<Underlying> |
write(@NotNull byte[] bytes,
int offset,
int length)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
@NotNull ByteBuffer bytes,
int offset,
int length) |
@NotNull Bytes<Underlying> |
write(long writeOffset,
@NotNull RandomDataInput bytes,
long readOffset,
long length) |
@NotNull Bytes<Underlying> |
write(@NotNull RandomDataInput bytes)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
writeByte(byte i8) |
@NotNull Bytes<Underlying> |
writeByte(long offset,
byte i)
Write an unsigned byte at an offset.
|
@NotNull Bytes<Underlying> |
writeDouble(double d) |
@NotNull Bytes<Underlying> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
@NotNull Bytes<Underlying> |
writeDoubleAndInt(double d,
int i) |
@NotNull Bytes<Underlying> |
writeFloat(float f) |
@NotNull Bytes<Underlying> |
writeFloat(long offset,
float d)
Write a float at an offset.
|
@NotNull Bytes<Underlying> |
writeInt(int i) |
@NotNull Bytes<Underlying> |
writeInt(long offset,
int i)
Write an int at an offset.
|
@NotNull Bytes<Underlying> |
writeIntAdv(int i,
int advance) |
long |
writeLimit() |
@NotNull Bytes<Underlying> |
writeLimit(long limit) |
@NotNull Bytes<Underlying> |
writeLong(long i64) |
@NotNull Bytes<Underlying> |
writeLong(long offset,
long i)
Write a long at an offset.
|
@NotNull Bytes<Underlying> |
writeLongAdv(long i64,
int advance) |
protected long |
writeOffsetPositionMoved(long adding) |
protected long |
writeOffsetPositionMoved(long adding,
long advance) |
@NotNull Bytes<Underlying> |
writeOrderedInt(int i) |
@NotNull Bytes<Underlying> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
@NotNull Bytes<Underlying> |
writeOrderedLong(long i) |
@NotNull Bytes<Underlying> |
writeOrderedLong(long offset,
long i)
Perform a non stalling write with a store barrier.
|
long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
@NotNull Bytes<Underlying> |
writePosition(long position) |
default long |
writeRemaining() |
@NotNull Bytes<Underlying> |
writeShort(long offset,
short i)
Write a short at an offset.
|
@NotNull Bytes<Underlying> |
writeShort(short i16) |
@NotNull Bytes<Underlying> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
@NotNull Bytes<Underlying> |
writeSome(@NotNull ByteBuffer buffer) |
@NotNull Bytes<Underlying> |
writeVolatileByte(long offset,
byte i8) |
@NotNull Bytes<Underlying> |
writeVolatileInt(long offset,
int i32) |
@NotNull Bytes<Underlying> |
writeVolatileLong(long offset,
long i64) |
@NotNull Bytes<Underlying> |
writeVolatileShort(long offset,
short i16) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitallocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, bytesForRead, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, from, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unwrite, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, write, writeMarshallableLength16addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForWrite, charAt, cipher, cipher, contentEquals, empty, endsWith, equalBytes, inside, inside, isEmpty, isPresent, isPresent, length, longCheckSum, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, writeMaxLong, zeroOutappend, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloatchars, codePointsbytesMethodReader, bytesMethodReaderBuilder, readObjectaddAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, canReadDirect, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBufferinputStream, parseHexLong, parseUTF, parseUtf8, rawReadByte, rawReadInt, read, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLength, readWithLength0bytesMethodWriter, bytesMethodWriterBuilder, writeObjectappend, append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writeralignBy, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, canWriteDirect, copyFrom, outputStream, rawWriteByte, rawWriteInt, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeUTFΔ, writeWithLengthprependcomment, indent, retainsCommentsprotected final long capacity
@NotNull protected @NotNull NativeBytesStore<Underlying> bytesStore
protected long readPosition
protected long writePosition
protected long writeLimit
public UncheckedNativeBytes(@NotNull
@NotNull Bytes<Underlying> underlyingBytes)
throws IllegalStateException
IllegalStateExceptionpublic void ensureCapacity(long size)
throws IllegalArgumentException
BytesBufferOverflowExceptionensureCapacity in interface Bytes<Underlying>size - the capacity that you requiredIllegalArgumentException - if the buffer is not elastic and there is not enough spacepublic boolean checkRefCount()
checkRefCount in interface BytesStore<Bytes<Underlying>,Underlying>public boolean unchecked()
unchecked in interface Bytes<Underlying>public boolean isDirectMemory()
isDirectMemory in interface BytesStore<Bytes<Underlying>,Underlying>@NotNull public @NotNull Bytes<Underlying> unchecked(boolean unchecked)
Bytesthis is elastic.unchecked in interface Bytes<Underlying>unchecked - if true, minimal bounds checks will be performed.public void move(long from,
long to,
long length)
move in interface BytesStore<Bytes<Underlying>,Underlying>@NotNull public @NotNull Bytes<Underlying> compact()
Bytescompact in interface Bytes<Underlying>@NotNull public @NotNull Bytes<Underlying> readPosition(long position)
@NotNull public @NotNull Bytes<Underlying> readLimit(long limit)
@NotNull public @NotNull Bytes<Underlying> writePosition(long position)
writePosition in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> readSkip(long bytesToSkip)
StreamingDataInputbytesToSkip - bytes to skip.public byte readVolatileByte(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileByte in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileShort in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileInt in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileLong in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic void uncheckedReadSkipOne()
StreamingDataInputpublic void uncheckedReadSkipBackOne()
StreamingDataInput@NotNull public @NotNull Bytes<Underlying> writeSkip(long bytesToSkip)
StreamingDataOutputwriteSkip in interface StreamingDataOutput<Bytes<Underlying>>bytesToSkip - bytes to skip.@NotNull public @NotNull Bytes<Underlying> writeLimit(long limit)
writeLimit in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull BytesStore<Bytes<Underlying>,Underlying> copy()
copy in interface Bytes<Underlying>copy in interface BytesStore<Bytes<Underlying>,Underlying>public boolean isElastic()
BytesBytes.realCapacity().isElastic in interface Bytes<Underlying>protected long readOffsetPositionMoved(long adding)
protected long writeOffsetPositionMoved(long adding)
protected long writeOffsetPositionMoved(long adding,
long advance)
protected long prewriteOffsetPositionMoved(long substracting)
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferUnderflowException, BufferOverflowException
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Underlying>>BufferUnderflowExceptionBufferOverflowExceptionpublic long rawCopy(@NotNull
@NotNull RandomDataInput bytes,
long offset,
long length)
throws BufferOverflowException,
BufferUnderflowException
@NotNull public @NotNull Bytes<Underlying> clear()
StreamingCommonclear in interface Bytes<Underlying>clear in interface StreamingCommon<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> clearAndPad(long length) throws BufferOverflowException
BytesPrependerclearAndPad in interface BytesPrepender<Bytes<Underlying>>length - to padBufferOverflowException - if the length > capacity() - start()public long readLimit()
public long writeLimit()
public long realCapacity()
RandomDataInputrealCapacity in interface Bytes<Underlying>realCapacity in interface BytesStore<Bytes<Underlying>,Underlying>realCapacity in interface RandomDataInputrealCapacity in interface StreamingDataOutput<Bytes<Underlying>>public long realWriteRemaining()
realWriteRemaining in interface StreamingDataOutput<Bytes<Underlying>>public long capacity()
capacity in interface BytesStore<Bytes<Underlying>,Underlying>@Nullable public Underlying underlyingObject()
underlyingObject in interface BytesStore<Bytes<Underlying>,Underlying>public long readPosition()
public long writePosition()
public boolean compareAndSwapInt(long offset,
int expected,
int value)
throws BufferOverflowException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionpublic void testAndSetInt(long offset,
int expected,
int value)
public boolean compareAndSwapLong(long offset,
long expected,
long value)
throws BufferOverflowException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionpublic int readUnsignedByte()
public int uncheckedReadUnsignedByte()
public byte readByte()
public int peekUnsignedByte()
public short readShort()
public int readInt()
public long readLong()
public float readFloat()
public double readDouble()
public int readVolatileInt()
public long readVolatileLong()
public void reserve()
throws IllegalStateException
reserve in interface net.openhft.chronicle.core.ReferenceCountedIllegalStateExceptionpublic void release()
throws IllegalStateException
release in interface net.openhft.chronicle.core.ReferenceCountedIllegalStateExceptionpublic long refCount()
refCount in interface net.openhft.chronicle.core.ReferenceCountedpublic boolean tryReserve()
tryReserve in interface net.openhft.chronicle.core.ReferenceCounted@NotNull public @NotNull Bytes<Underlying> writeByte(long offset, byte i) throws BufferOverflowException
RandomDataOutputwriteByte in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeShort(long offset, short i) throws BufferOverflowException
RandomDataOutputwriteShort in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeInt(long offset, int i) throws BufferOverflowException
RandomDataOutputwriteInt in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeOrderedInt(long offset, int i) throws BufferOverflowException
RandomDataOutputwriteOrderedInt in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - value to writeBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeLong(long offset, long i) throws BufferOverflowException
RandomDataOutputwriteLong in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutputwriteOrderedLong in interface RandomDataOutput<Bytes<Underlying>>offset - to write toi - value to writeBufferOverflowException@NotNull public @NotNull Bytes<Underlying> writeFloat(long offset, float d) throws BufferOverflowException
RandomDataOutputwriteFloat in interface RandomDataOutput<Bytes<Underlying>>offset - to write tod - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutputwriteDouble in interface RandomDataOutput<Bytes<Underlying>>offset - to write tod - the valueBufferOverflowException - if the capacity was exceeded@NotNull public @NotNull Bytes<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
writeVolatileByte in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowException@NotNull public @NotNull Bytes<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException
writeVolatileShort in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowException@NotNull public @NotNull Bytes<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException
writeVolatileInt in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowException@NotNull public @NotNull Bytes<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException
writeVolatileLong in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowException@NotNull public @NotNull Bytes<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException
write in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowExceptionpublic void write(long offsetInRDO,
@NotNull
@NotNull ByteBuffer bytes,
int offset,
int length)
throws BufferOverflowException
write in interface RandomDataOutput<Bytes<Underlying>>BufferOverflowException@NotNull public @NotNull Bytes<Underlying> write(long writeOffset, @NotNull @NotNull RandomDataInput bytes, long readOffset, long length) throws BufferUnderflowException, BufferOverflowException
write in interface RandomDataOutput<Bytes<Underlying>>BufferUnderflowExceptionBufferOverflowExceptionpublic byte readByte(long offset)
RandomDataInputreadByte in interface RandomDataInputoffset - to readpublic int readUnsignedByte(long offset)
RandomDataInputreadUnsignedByte in interface RandomDataInputoffset - to readpublic int peekUnsignedByte(long offset)
RandomDataInputpeekUnsignedByte in interface RandomDataInputoffset - to readpublic short readShort(long offset)
RandomDataInputreadShort in interface RandomDataInputoffset - to readpublic int readInt(long offset)
RandomDataInputreadInt in interface RandomDataInputoffset - to readpublic long readLong(long offset)
RandomDataInputreadLong in interface RandomDataInputoffset - to readpublic float readFloat(long offset)
RandomDataInputreadFloat in interface RandomDataInputoffset - to readpublic double readDouble(long offset)
RandomDataInputreadDouble in interface RandomDataInputoffset - to read@NotNull public @NotNull Bytes<Underlying> writeByte(byte i8)
writeByte in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> prewriteByte(byte i8)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewriteByte in interface BytesPrepender<Bytes<Underlying>>i8 - byte to prepend to.@NotNull public @NotNull Bytes<Underlying> writeShort(short i16)
writeShort in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> prewriteShort(short i16)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewriteShort in interface BytesPrepender<Bytes<Underlying>>i16 - short to prepend to.@NotNull public @NotNull Bytes<Underlying> writeInt(int i)
writeInt in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeIntAdv(int i, int advance)
writeIntAdv in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> prewriteInt(int i)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewriteInt in interface BytesPrepender<Bytes<Underlying>>i - integer to prepend to.@NotNull public @NotNull Bytes<Underlying> writeLong(long i64)
writeLong in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeLongAdv(long i64, int advance)
writeLongAdv in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> prewriteLong(long i64)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewriteLong in interface BytesPrepender<Bytes<Underlying>>i64 - long to prepend to.@NotNull public @NotNull Bytes<Underlying> writeFloat(float f)
writeFloat in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeDouble(double d)
writeDouble in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeDoubleAndInt(double d, int i)
writeDoubleAndInt in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull byte[] bytes, int offset, int length)
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> prewrite(@NotNull @NotNull byte[] bytes)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewrite in interface BytesPrepender<Bytes<Underlying>>bytes - to prepend to.@NotNull public @NotNull Bytes<Underlying> prewrite(@NotNull @NotNull BytesStore bytes)
BytesPrependerNote: it moves the readPosition not the writePosition / readLimit
prewrite in interface BytesPrepender<Bytes<Underlying>>bytes - to prepend to.@NotNull public @NotNull Bytes<Underlying> writeSome(@NotNull @NotNull ByteBuffer buffer)
writeSome in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeOrderedInt(int i)
writeOrderedInt in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Bytes<Underlying> writeOrderedLong(long i)
writeOrderedLong in interface StreamingDataOutput<Bytes<Underlying>>public long addressForRead(long offset)
throws BufferUnderflowException
offset - within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.BufferUnderflowException - if the offset is before the start() or the after the capacity()public long addressForWrite(long offset)
throws BufferOverflowException
offset - within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.BufferOverflowException - if the offset is before the start() or the after the capacity()public long addressForWritePosition()
throws UnsupportedOperationException,
BufferOverflowException
public boolean equalsBytes(@NotNull
@NotNull Bytes b2,
long remaining)
@NotNull public @NotNull String toString()
toString in interface CharSequencetoString in class Objectpublic void nativeRead(long address,
long size)
StreamingDataInputaddress - of the memory.size - in bytes.public void lenient(boolean lenient)
StreamingDataInputlenient - if true, return nothing rather than error.public boolean lenient()
public void nativeWrite(long address,
long size)
StreamingDataOutputnativeWrite in interface StreamingDataOutput<Bytes<Underlying>>address - to write to.size - in bytes.public 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<Bytes<Underlying>>address - in native memory to copy fromposition - in BytesStore to copy tosize - in bytes@Nullable public @Nullable BytesStore bytesStore()
bytesStore in interface Bytes<Underlying>bytesStore in interface BytesStore<Bytes<Underlying>,Underlying>public int byteCheckSum()
throws net.openhft.chronicle.core.io.IORuntimeException
BytesStorebyteCheckSum in interface BytesStore<Bytes<Underlying>,Underlying>net.openhft.chronicle.core.io.IORuntimeException@NotNull public @NotNull Bytes<Underlying> append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException
ByteStringAppenderappend8bit in interface ByteStringAppender<Bytes<Underlying>>cs - to writeBufferOverflowException - If the string as too large to write in the capacity availableBufferUnderflowException - if the capacity of the underlying buffer was exceeded@NotNull public @NotNull Bytes<Underlying> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
appendUtf8 in interface StreamingDataOutput<Bytes<Underlying>>BufferOverflowExceptionIllegalArgumentExceptionpublic int lastDecimalPlaces()
public void lastDecimalPlaces(int lastDecimalPlaces)
lastDecimalPlaces - set the number of decimal places if positive, otherwise 0.@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull RandomDataInput bytes)
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Underlying>>@NotNull public @NotNull Reader reader()
@Nullable public @Nullable Boolean parseBoolean(@NotNull @NotNull StopCharTester tester)
false: f, false, n, no, 0
true: t, true, y, yes, 1
tester - to detect the end of the text.@Nullable public @Nullable Boolean parseBoolean()
@NotNull public @NotNull String parseUtf8(@NotNull @NotNull StopCharTester stopCharTester)
stopCharTester - to check if the end has been reached.@NotNull @Deprecated public @NotNull String parseUTF(@NotNull @NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull
@NotNull Appendable buffer,
@NotNull
@NotNull StopCharTester stopCharTester)
throws BufferUnderflowException
buffer - to populatestopCharTester - to check if the end has been reached.BufferUnderflowException@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
BufferUnderflowExceptionpublic void parseUtf8(@NotNull
@NotNull Appendable buffer,
@NotNull
@NotNull StopCharsTester stopCharsTester)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
buffer - to populatestopCharsTester - to check if the end has been reached.BufferUnderflowExceptionnet.openhft.chronicle.core.io.IORuntimeException@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic void parse8bit(Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
buffer - to populatestopCharTester - to check if the end has been reached.BufferUnderflowExceptionpublic String parse8bit(@NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
stopCharTester - to check if the end has been reached.BufferUnderflowExceptionpublic void parse8bit(Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
buffer - to populatestopCharsTester - to check if the end has been reached.BufferUnderflowExceptionpublic void parse8bit(Bytes buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
BufferUnderflowExceptionpublic void parse8bit(StringBuilder buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
BufferUnderflowExceptionpublic int parseInt()
throws BufferUnderflowException
BufferUnderflowExceptionpublic long parseLong()
throws BufferUnderflowException
BufferUnderflowExceptionpublic float parseFloat()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic double parseDouble()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic long parseLongDecimal()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic boolean skipTo(@NotNull
@NotNull StopCharTester tester)
tester - to stop at@NotNull public @NotNull BigDecimal parseBigDecimal()
public long start()
public long readRemaining()
public long writeRemaining()
public long addressForRead(long offset,
int buffer)
throws UnsupportedOperationException,
BufferUnderflowException
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset,
float expected,
float value)
throws BufferOverflowException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionpublic boolean compareAndSwapDouble(long offset,
double expected,
double value)
throws BufferOverflowException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionCopyright © 2020. All rights reserved.