public abstract class AbstractBytes<Underlying> extends net.openhft.chronicle.core.io.AbstractReferenceCounted implements Bytes<Underlying>
Modifier and Type | Field and Description |
---|---|
protected @NotNull BytesStore<Bytes<Underlying>,Underlying> |
bytesStore |
protected boolean |
isPresent |
protected long |
readPosition |
protected long |
writeLimit |
protected long |
writePosition |
referenceCounted, WARN_COUNT, WARN_NS
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITY, MAX_HEAP_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWritePosition() |
@NotNull AbstractBytes |
append(double d)
Append a double in decimal notation
|
int |
byteCheckSum()
Return the bytes sum of the readable bytes.
|
int |
byteCheckSum(int start,
int end) |
int |
byteCheckSum(long start,
long end) |
@NotNull BytesStore |
bytesStore() |
protected void |
bytesStore(BytesStore<Bytes<Underlying>,Underlying> bytesStore) |
boolean |
canReadDirect(long length) |
boolean |
canWriteDirect(long count) |
long |
capacity() |
@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.
|
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.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isDirectMemory() |
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 position,
long address,
long size)
expert level method for copying 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
|
protected void |
performRelease() |
@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 l)
Write backward in binary an 8 byte long
|
protected long |
prewriteOffsetPositionMoved(long subtracting) |
@NotNull Bytes<Underlying> |
prewriteShort(short i)
Write backward in binary a 2 byte int
|
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) |
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()
Deprecated.
|
protected int |
safeCopySize() |
default boolean |
skipTo(@NotNull StopCharTester tester)
Skip text until a terminating character is reached.
|
long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
@NotNull String |
toString() |
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,
ByteBuffer bytes,
int offset,
int length) |
@NotNull Bytes<Underlying> |
write(long writeOffset,
RandomDataInput bytes,
long readOffset,
long length) |
@NotNull Bytes<Underlying> |
write(@NotNull RandomDataInput bytes)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
write8bit(@Nullable BytesStore bs) |
long |
write8bit(long position,
BytesStore bs)
Write the stop bit length and copy the BytesStore
|
long |
write8bit(long position,
String s,
int start,
int length) |
@NotNull Bytes<Underlying> |
write8bit(@NotNull String s,
int start,
int length) |
@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)
Write a long
|
@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) |
@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) |
assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, performReleaseInBackground, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, bytesForRead, copy, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, ensureCapacity, from, from, fromDirect, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isElastic, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, valueOf, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, write, writeMarshallableLength16
addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesForWrite, charAt, cipher, cipher, contentEquals, empty, endsWith, equalBytes, from, hash, inside, inside, isEmpty, isEqual, length, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, writeMaxInt, writeMaxLong, zeroOut
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
bytesMethodReader, bytesMethodReaderBuilder, readObject
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
inputStream, parseHexLong, parseUTF, parseUtf8, parseUtf8, rawReadByte, rawReadInt, rawReadLong, read, read, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readLimitToCapacity, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLength, readWithLength0, unsafeReadObject, unsafeReadObject
bytesMethodWriter, writeObject
append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
alignBy, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write, write, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeUTFΔ, writeWithLength
prepend
comment, indent, retainsComments
@NotNull protected @NotNull BytesStore<Bytes<Underlying>,Underlying> bytesStore
protected long readPosition
protected long writePosition
protected long writeLimit
protected boolean isPresent
public boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<Underlying>,Underlying>
public boolean canReadDirect(long length)
canReadDirect
in interface RandomDataInput
public void move(long from, long to, long length) throws BufferUnderflowException, IllegalStateException, ArithmeticException
move
in interface BytesStore<Bytes<Underlying>,Underlying>
BufferUnderflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Underlying> compact() throws IllegalStateException
Bytes
compact
in interface Bytes<Underlying>
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> clear() throws IllegalStateException
StreamingCommon
clear
in interface Bytes<Underlying>
clear
in interface StreamingCommon<Bytes<Underlying>>
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> clearAndPad(long length) throws BufferOverflowException
BytesPrepender
clearAndPad
in interface BytesPrepender<Bytes<Underlying>>
length
- to padBufferOverflowException
- if the length > capacity() - start()public long readLimit()
public long writeLimit()
public long realCapacity()
RandomDataInput
realCapacity
in interface Bytes<Underlying>
realCapacity
in interface BytesStore<Bytes<Underlying>,Underlying>
realCapacity
in interface RandomDataInput
realCapacity
in interface StreamingDataOutput<Bytes<Underlying>>
@Deprecated public long realWriteRemaining()
public boolean canWriteDirect(long count)
canWriteDirect
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 start()
public long readPosition()
public long writePosition()
public boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public void testAndSetInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
@NotNull public @NotNull AbstractBytes append(double d) throws BufferOverflowException, IllegalStateException
ByteStringAppender
append
in interface ByteStringAppender<Bytes<Underlying>>
d
- to appendBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> readPosition(long position) throws BufferUnderflowException, IllegalStateException
readPosition
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> readLimit(long limit) throws BufferUnderflowException
readLimit
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
@NotNull public @NotNull Bytes<Underlying> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public @NotNull Bytes<Underlying> readSkip(long bytesToSkip) throws BufferUnderflowException, IllegalStateException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public void uncheckedReadSkipOne()
StreamingDataInput
uncheckedReadSkipOne
in interface StreamingDataInput<Bytes<Underlying>>
public void uncheckedReadSkipBackOne()
StreamingDataInput
uncheckedReadSkipBackOne
in interface StreamingDataInput<Bytes<Underlying>>
@NotNull public @NotNull Bytes<Underlying> writeSkip(long bytesToSkip) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the BytesIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeLimit(long limit) throws BufferOverflowException
writeLimit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
protected void performRelease()
performRelease
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public int readUnsignedByte() throws IllegalStateException
readUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
IllegalStateException
public int readUnsignedByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readUnsignedByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public int uncheckedReadUnsignedByte()
uncheckedReadUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
public byte readByte() throws IllegalStateException
readByte
in interface StreamingDataInput<Bytes<Underlying>>
IllegalStateException
public int peekUnsignedByte() throws IllegalStateException
peekUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
IllegalStateException
public short readShort() throws BufferUnderflowException, IllegalStateException
readShort
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public int readInt() throws BufferUnderflowException, IllegalStateException
readInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public byte readVolatileByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public short readVolatileShort(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileShort
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public int readVolatileInt(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileInt
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public long readVolatileLong(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileLong
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public long readLong() throws BufferUnderflowException, IllegalStateException
readLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public float readFloat() throws BufferUnderflowException, IllegalStateException
readFloat
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public double readDouble() throws BufferUnderflowException, IllegalStateException
readDouble
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public int readVolatileInt() throws BufferUnderflowException, IllegalStateException
readVolatileInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
public long readVolatileLong() throws BufferUnderflowException, IllegalStateException
readVolatileLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
IllegalStateException
protected long readOffsetPositionMoved(long adding) throws BufferUnderflowException, IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeByte(long offset, byte i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeByte
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeShort(long offset, short i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeShort
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeInt(long offset, int i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeOrderedInt(long offset, int i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeLong(long offset, long i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeFloat(long offset, float d) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeFloat
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeDouble(long offset, double d) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeDouble
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException, IllegalStateException
writeVolatileByte
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException, IllegalStateException
writeVolatileShort
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException, IllegalStateException
writeVolatileInt
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException, IllegalStateException
writeVolatileLong
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull RandomDataInput bytes) throws IllegalStateException, BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Underlying>>
IllegalStateException
BufferOverflowException
@NotNull public @NotNull Bytes<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalStateException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length) throws BufferOverflowException, IllegalStateException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> write8bit(@NotNull @NotNull String s, int start, int length) throws BufferOverflowException, IndexOutOfBoundsException, ArithmeticException, IllegalStateException, BufferUnderflowException
write8bit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IndexOutOfBoundsException
ArithmeticException
IllegalStateException
BufferUnderflowException
@NotNull public @NotNull Bytes<Underlying> write8bit(@Nullable @Nullable BytesStore bs) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
write8bit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
public long write8bit(long position, BytesStore bs)
RandomDataOutput
write8bit
in interface RandomDataOutput<Bytes<Underlying>>
position
- to writebs
- to copy.RandomDataOutput
public long write8bit(long position, String s, int start, int length)
write8bit
in interface RandomDataOutput<Bytes<Underlying>>
public byte readByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public int peekUnsignedByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
IllegalStateException
public short readShort(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readShort
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public int readInt(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readInt
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public long readLong(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readLong
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public float readFloat(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readFloat
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public double readDouble(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readDouble
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeByte(byte i8) throws BufferOverflowException, IllegalStateException
writeByte
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewrite(@NotNull @NotNull byte[] bytes) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Underlying>>
bytes
- to prepend to.BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewrite(@NotNull @NotNull BytesStore bytes) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Underlying>>
bytes
- to prepend to.BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewriteByte(byte i8) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteByte
in interface BytesPrepender<Bytes<Underlying>>
i8
- byte to prepend to.BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewriteInt(int i) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteInt
in interface BytesPrepender<Bytes<Underlying>>
i
- integer to prepend to.BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewriteShort(short i) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteShort
in interface BytesPrepender<Bytes<Underlying>>
i
- short to prepend to.BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> prewriteLong(long l) throws BufferOverflowException, IllegalStateException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteLong
in interface BytesPrepender<Bytes<Underlying>>
l
- long to prepend to.BufferOverflowException
IllegalStateException
protected final long writeOffsetPositionMoved(long adding) throws BufferOverflowException, IllegalStateException
protected long writeOffsetPositionMoved(long adding, long advance) throws BufferOverflowException, IllegalStateException
protected long prewriteOffsetPositionMoved(long subtracting) throws BufferOverflowException, IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeShort(short i16) throws BufferOverflowException, IllegalStateException
writeShort
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeInt(int i) throws BufferOverflowException, IllegalStateException
writeInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeIntAdv(int i, int advance) throws BufferOverflowException, IllegalStateException
writeIntAdv
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeLong(long i64) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeLongAdv(long i64, int advance) throws BufferOverflowException, IllegalStateException
writeLongAdv
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeFloat(float f) throws BufferOverflowException, IllegalStateException
writeFloat
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeDouble(double d) throws BufferOverflowException, IllegalStateException
writeDouble
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeDoubleAndInt(double d, int i) throws BufferOverflowException, IllegalStateException
writeDoubleAndInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
IllegalArgumentException
protected int safeCopySize()
@NotNull public @NotNull Bytes<Underlying> writeSome(@NotNull @NotNull ByteBuffer buffer) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
writeSome
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
@NotNull public @NotNull Bytes<Underlying> writeOrderedInt(int i) throws BufferOverflowException, IllegalStateException
writeOrderedInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeOrderedLong(long i) throws BufferOverflowException, IllegalStateException
writeOrderedLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalStateException
public long addressForRead(long offset) throws BufferUnderflowException, IllegalStateException
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()IllegalStateException
public long addressForWrite(long offset) throws BufferOverflowException, IllegalStateException
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()IllegalStateException
public long addressForWritePosition() throws BufferOverflowException, IllegalStateException
@NotNull public @NotNull String toString()
toString
in interface CharSequence
toString
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public void nativeRead(long position, long address, long size) throws BufferUnderflowException, IllegalStateException
RandomDataInput
nativeRead
in interface RandomDataInput
position
- within the ByteStore to copy.address
- in native memorysize
- in bytesBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public void nativeWrite(long address, long position, long size) throws BufferOverflowException, IllegalStateException
RandomDataOutput
nativeWrite
in interface RandomDataOutput<Bytes<Underlying>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytesBufferOverflowException
IllegalStateException
@NotNull public @NotNull BytesStore bytesStore()
bytesStore
in interface Bytes<Underlying>
bytesStore
in interface BytesStore<Bytes<Underlying>,Underlying>
protected void bytesStore(BytesStore<Bytes<Underlying>,Underlying> bytesStore)
public int lastDecimalPlaces()
public void lastDecimalPlaces(int lastDecimalPlaces)
lastDecimalPlaces
- set the number of decimal places if positive, otherwise 0.public void lenient(boolean lenient)
StreamingDataInput
lenient
in interface StreamingDataInput<Bytes<Underlying>>
lenient
- if true, return nothing rather than error.public boolean lenient()
lenient
in interface StreamingDataInput<Bytes<Underlying>>
public int byteCheckSum() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException
BytesStore
byteCheckSum
in interface BytesStore<Bytes<Underlying>,Underlying>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
public int byteCheckSum(long start, long end) throws BufferUnderflowException, IllegalStateException
byteCheckSum
in interface BytesStore<Bytes<Underlying>,Underlying>
BufferUnderflowException
IllegalStateException
public int byteCheckSum(int start, int end) throws BufferUnderflowException, IllegalStateException
@NotNull public @NotNull Reader reader()
@Nullable public @Nullable Boolean parseBoolean(@NotNull @NotNull StopCharTester tester) throws BufferUnderflowException, IllegalStateException, ArithmeticException
false: f, false, n, no, 0
true: t, true, y, yes, 1
tester
- to detect the end of the text.BufferUnderflowException
IllegalStateException
ArithmeticException
@Nullable public @Nullable Boolean parseBoolean() throws BufferUnderflowException, IllegalStateException, ArithmeticException
@NotNull public @NotNull String parseUtf8(@NotNull @NotNull StopCharTester stopCharTester) throws IllegalStateException, ArithmeticException
stopCharTester
- to check if the end has been reached.IllegalStateException
ArithmeticException
@NotNull @Deprecated public @NotNull String parseUTF(@NotNull @NotNull StopCharTester stopCharTester) throws IllegalStateException, ArithmeticException
public void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
IllegalStateException
ArithmeticException
@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, IllegalStateException, ArithmeticException
public void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
public void parse8bit(Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IllegalStateException
ArithmeticException
public String parse8bit(@NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, IllegalStateException
stopCharTester
- to check if the end has been reached.BufferUnderflowException
IllegalStateException
public void parse8bit(Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IllegalStateException
ArithmeticException
public void parse8bit(Bytes buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
public void parse8bit(StringBuilder buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws IllegalStateException
IllegalStateException
public int parseInt() throws BufferUnderflowException, ArithmeticException, IllegalStateException
BufferUnderflowException
ArithmeticException
IllegalStateException
public long parseLong() throws BufferUnderflowException, IllegalStateException
BufferUnderflowException
IllegalStateException
public float parseFloat() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
public double parseDouble() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
public long parseLongDecimal() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
public boolean skipTo(@NotNull @NotNull StopCharTester tester) throws IllegalStateException
tester
- to stop atIllegalStateException
@NotNull public @NotNull BigDecimal parseBigDecimal() throws IllegalStateException, ArithmeticException
Copyright © 2021. All rights reserved.