public class HexDumpBytes extends Object implements Bytes<Void>
Modifier and Type | Field and Description |
---|---|
static long |
MASK |
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_CAPACITY, MAX_HEAP_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Constructor and Description |
---|
HexDumpBytes() |
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 BytesStore |
bytesStore()
Returns the backing ByteStore this Bytes object wraps, or null.
|
long |
capacity() |
@NotNull Bytes<Void> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
@NotNull Bytes<Void> |
clearAndPad(long length)
Clear a buffer, with a given padding to allow for prepending later.
|
Bytes<Void> |
comment(@NotNull CharSequence comment)
Add comment as appropriate for the toHexString format
|
@NotNull Bytes<Void> |
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.
|
BytesStore |
copy()
Creates and returns a new copy of this Bytes object from
RandomCommon.readPosition()
to RandomCommon.readLimit() . |
void |
ensureCapacity(long desiredCapacity)
Grows the buffer if the buffer is elastic, if the buffer is not elastic and there is not
enough capacity then this method will throw an
DecoratedBufferOverflowException |
boolean |
equals(Object obj) |
static HexDumpBytes |
fromText(@NotNull CharSequence text) |
static HexDumpBytes |
fromText(@NotNull Reader reader) |
int |
hashCode() |
BytesOut<Void> |
indent(int n)
Adjust the indent for nested data
|
boolean |
isDirectMemory() |
boolean |
isElastic()
Returns if this Bytes object is elastic.
|
int |
lastDecimalPlaces() |
void |
lastDecimalPlaces(int lastDecimalPlaces)
Store the last number of decimal places.
|
boolean |
lastNumberHadDigits() |
void |
lastNumberHadDigits(boolean lastNumberHadDigits) |
long |
lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
|
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
|
int |
numberWrap() |
HexDumpBytes |
numberWrap(int numberWrap) |
HexDumpBytes |
offsetFormat(OffsetFormat offsetFormat) |
int |
peekUnsignedByte() |
int |
peekUnsignedByte(long offset)
Read an unsigned byte at an offset, or -1
|
@NotNull Bytes<Void> |
prewrite(byte[] bytes)
Write backward in binary a byte
|
@NotNull Bytes<Void> |
prewrite(BytesStore bytes)
Write backward in binary a byte
|
@NotNull Bytes<Void> |
prewriteByte(byte b)
Write backward in binary a byte
|
@NotNull Bytes<Void> |
prewriteInt(int i)
Write backward in binary a 4 byte int
|
@NotNull Bytes<Void> |
prewriteLong(long l)
Write backward in binary an 8 byte long
|
@NotNull Bytes<Void> |
prewriteShort(short i)
Write backward in binary a 2 byte int
|
int |
read(byte[] bytes) |
int |
read(byte[] bytes,
int off,
int len) |
void |
read(@NotNull ByteBuffer buffer) |
void |
read(@NotNull Bytes<?> bytes,
int length) |
int |
read(char[] bytes,
int off,
int len) |
@Nullable String |
read8bit() |
boolean |
read8bit(@NotNull Bytes<?> b) |
boolean |
read8bit(@NotNull StringBuilder sb) |
@NotNull BigDecimal |
readBigDecimal()
Creates and returns a new BigDecimal representing the contents of this Bytes object.
|
@NotNull BigInteger |
readBigInteger()
Creates and returns a new BigInteger representing the contents of this Bytes object or
BigInteger.ZERO
if this Bytes object is empty. |
boolean |
readBoolean() |
byte |
readByte() |
byte |
readByte(long offset)
Read byte at an offset
|
double |
readDouble() |
double |
readDouble(long offset)
Read a double at an offset
|
<E extends Enum<E>> |
readEnum(@NotNull Class<E> eClass) |
float |
readFloat() |
float |
readFloat(long offset)
Read a float at an offset
|
void |
readHistogram(@NotNull net.openhft.chronicle.core.util.Histogram histogram) |
int |
readInt() |
int |
readInt(long offset)
Read an int at an offset
|
int |
readInt24() |
long |
readLimit()
If the resource is closed, the returned value is unspecified.
|
@NotNull Bytes<Void> |
readLimit(long limit) |
long |
readLong() |
long |
readLong(long offset)
Read a long at an offset
|
<T extends ReadBytesMarshallable> |
readMarshallableLength16(@NotNull Class<T> clazz,
T using)
Reads the content of this Bytes object converting it to an object of the provided
clazz using the
provided using , or if null is provided for using , creates a new object, eventually
returning whichever object was updated. |
long |
readPosition()
Returns the read position.
|
@NotNull Bytes<Void> |
readPosition(long position) |
@NotNull Bytes<Void> |
readPositionRemaining(long position,
long remaining) |
@NotNull Bytes<Void> |
readPositionUnlimited(long position) |
long |
readRemaining()
Returns the remaining bytes that can be read.
|
short |
readShort() |
short |
readShort(long offset)
Read a short at an offset
|
@NotNull Bytes<Void> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
long |
readStopBit() |
char |
readStopBitChar() |
double |
readStopBitDecimal() |
double |
readStopBitDouble() |
int |
readUnsignedByte() |
long |
readUnsignedInt() |
int |
readUnsignedInt24() |
int |
readUnsignedShort() |
@Nullable String |
readUtf8()
The same as readUTF() except the length is stop bit encoded.
|
<C extends Appendable & CharSequence> |
readUtf8(C sb)
The same as readUtf8() except the chars are copied to a truncated StringBuilder.
|
<C extends Appendable & CharSequence> |
readUtf8(long offset,
C sb)
Truncates
sb (it must be a StringBuilder or Bytes ) and reads a char
sequence from the given offset , encoded as Utf8, into it. |
<C extends Appendable & CharSequence> |
readUtf8Limited(long offset,
C sb,
int maxUtf8Len)
Truncates
sb (it must be a StringBuilder or Bytes ) and reads a char
sequence from the given offset , encoded as Utf8, into it. |
@Nullable String |
readUtf8Limited(long offset,
int maxUtf8Len)
Reads a char sequence from the given
offset , encoded as Utf8. |
<C extends Appendable & CharSequence> |
readUTFΔ(C sb) |
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.
|
void |
readWithLength(@NotNull Bytes<?> bytes) |
void |
readWithLength(long length,
@NotNull BytesOut<Void> bytesOut)
Writes the content of this Bytes object into the provided
bytesOut writing the provided
length bytes. |
void |
readWithLength(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumer<Bytes<Void>,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer)
Perform a set of actions with a temporary bounds mode.
|
void |
readWithLength0(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<Bytes<Void>,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer,
StringBuilder sb,
BytesOut<?> toBytes)
Perform a set of actions with a temporary bounds mode.
|
int |
refCount() |
void |
release(net.openhft.chronicle.core.io.ReferenceOwner owner) |
void |
releaseLast(net.openhft.chronicle.core.io.ReferenceOwner owner) |
void |
reserve(net.openhft.chronicle.core.io.ReferenceOwner owner) |
boolean |
reservedBy(net.openhft.chronicle.core.io.ReferenceOwner owner) |
boolean |
retainsComments()
Do these Bytes support saving comments as descriptions for fields.
|
void |
singleThreadedCheckDisabled(boolean singleThreadedCheckDisabled) |
void |
singleThreadedCheckReset() |
void |
testAndSetInt(long offset,
int expected,
int value) |
@NotNull String |
toHexString()
Creates and returns a new String representing the contents of this Bytes object in hexadecimal form encoding
at most 1024 bytes.
|
@NotNull String |
toString() |
boolean |
tryReserve(net.openhft.chronicle.core.io.ReferenceOwner owner) |
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() |
@Nullable Void |
underlyingObject() |
@NotNull Bytes<Void> |
write(byte[] byteArray)
Write all data or fail.
|
@NotNull Bytes<Void> |
write(byte[] byteArray,
int offset,
int length)
Writes all data from the provided
byteArray into this Bytes object. |
Bytes<Void> |
write(@NotNull BytesStore<?,?> bytes)
Writes all the passed BytesStore or it fails.
|
@NotNull Bytes<Void> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Void> |
write(@NotNull CharSequence text)
Writes the provided
text to this StreamingDataOutput at the current writePosition(). |
@NotNull Bytes<Void> |
write(@NotNull CharSequence text,
int startText,
int length)
Writes the provided
text to this StreamingDataOutput at the current writePosition() |
Bytes<?> |
write(@NotNull InputStream inputStream)
Writes the contents of the provided `inputStream` to the contents of this Bytes object.
|
@NotNull Bytes<Void> |
write(long offsetInRDO,
byte[] byteArray,
int offset,
int length)
Copies the provided
byteArray to this Bytes object starting at writeOffset taking
content starting at readOffset but copying at most length bytes. |
void |
write(long offsetInRDO,
@NotNull ByteBuffer bytes,
int offset,
int length)
Copy from ByteBuffer into this.
|
@NotNull Bytes<Void> |
write(long writeOffset,
@NotNull RandomDataInput bytes,
long readOffset,
long length)
Copy from RandomDataInput into this.
|
@NotNull Bytes<Void> |
write(@NotNull RandomDataInput bytes)
Write all data or fail.
|
@NotNull Bytes<Void> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Void> |
write8bit(@Nullable BytesStore bs) |
@NotNull Bytes<Void> |
write8bit(@Nullable CharSequence text) |
@NotNull Bytes<Void> |
write8bit(@NotNull CharSequence text,
int start,
int length) |
long |
write8bit(long position,
@NotNull BytesStore bs)
Write the stop bit length and copy the BytesStore
|
long |
write8bit(long position,
@NotNull String s,
int start,
int length) |
@NotNull Bytes<Void> |
write8bit(@Nullable String s) |
@NotNull Bytes<Void> |
write8bit(@NotNull String text,
int start,
int length) |
void |
writeBigDecimal(@NotNull BigDecimal bd) |
void |
writeBigInteger(@NotNull BigInteger bi) |
@NotNull Bytes<Void> |
writeBoolean(boolean flag) |
@NotNull Bytes<Void> |
writeByte(byte i8) |
@NotNull Bytes<Void> |
writeByte(long offset,
byte i8)
Write an unsigned byte at an offset.
|
@NotNull Bytes<Void> |
writeDouble(double d) |
@NotNull Bytes<Void> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
@NotNull Bytes<Void> |
writeDoubleAndInt(double d,
int i) |
<E extends Enum<E>> |
writeEnum(E e) |
@NotNull Bytes<Void> |
writeFloat(float f) |
@NotNull Bytes<Void> |
writeFloat(long offset,
float d)
Write a float at an offset.
|
void |
writeHistogram(@NotNull net.openhft.chronicle.core.util.Histogram histogram) |
@NotNull Bytes<Void> |
writeInt(int i) |
@NotNull Bytes<Void> |
writeInt(long offset,
int i)
Write an int at an offset.
|
@NotNull Bytes<Void> |
writeInt24(int i) |
@NotNull Bytes<Void> |
writeInt24(long offset,
int i) |
@NotNull Bytes<Void> |
writeIntAdv(int i,
int advance) |
long |
writeLimit()
Returns the write limit.
|
@NotNull Bytes<Void> |
writeLimit(long limit) |
@NotNull Bytes<Void> |
writeLong(long i64)
Write a long
|
@NotNull Bytes<Void> |
writeLong(long offset,
long i)
Write a long at an offset.
|
@NotNull Bytes<Void> |
writeLongAdv(long i64,
int advance) |
void |
writeMarshallableLength16(@NotNull WriteBytesMarshallable marshallable)
Writes the content of the provided
marshallable to this Bytes object converting from an object
to a number of bytes. |
@NotNull Bytes<Void> |
writeOrderedInt(int i) |
@NotNull Bytes<Void> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
@NotNull Bytes<Void> |
writeOrderedLong(long i) |
@NotNull Bytes<Void> |
writeOrderedLong(long offset,
long i)
Perform a non stalling write with a store barrier.
|
long |
writePosition()
For HexDumpBytes it needs to remember the writePosition for the underlying bytes as well as the text hex dump, so it encodes both in one number so you can call writePosition later.
|
@NotNull Bytes<Void> |
writePosition(long position) |
void |
writePositionRemaining(long position,
long length) |
long |
writeRemaining()
If the resource is closed, the returned value is unspecified.
|
@NotNull Bytes<Void> |
writeShort(long offset,
short i)
Write a short at an offset.
|
@NotNull Bytes<Void> |
writeShort(short i16) |
@NotNull Bytes<Void> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
@NotNull Bytes<Void> |
writeSome(@NotNull ByteBuffer buffer)
Write all data available from buffer, constrained by how much space available in this.
|
@NotNull Bytes<Void> |
writeSome(@NotNull Bytes<?> bytes)
Write all data available from bytes argument, constrained by how much space available in this.
|
@NotNull Bytes<Void> |
writeStopBit(char x) |
@NotNull Bytes<Void> |
writeStopBit(double d) |
@NotNull Bytes<Void> |
writeStopBit(long x)
Write a stop bit encoded long
|
@NotNull Bytes<Void> |
writeStopBitDecimal(double d) |
@NotNull Bytes<Void> |
writeUnsignedByte(int i) |
@NotNull Bytes<Void> |
writeUnsignedInt(long i) |
@NotNull Bytes<Void> |
writeUnsignedInt24(int i) |
@NotNull Bytes<Void> |
writeUnsignedShort(int u16) |
@NotNull Bytes<Void> |
writeUtf8(@Nullable CharSequence text)
Write the same encoding as
writeUTF with the following changes. |
@NotNull Bytes<Void> |
writeUtf8(@Nullable String text) |
@NotNull Bytes<Void> |
writeVolatileByte(long offset,
byte i8) |
@NotNull Bytes<Void> |
writeVolatileInt(long offset,
int i32) |
@NotNull Bytes<Void> |
writeVolatileLong(long offset,
long i64) |
@NotNull Bytes<Void> |
writeVolatileShort(long offset,
short i16) |
void |
writeWithLength(@NotNull RandomDataInput bytes) |
@NotNull Bytes<Void> |
zeroOut(long start,
long end)
Fills the BytesStore with zeros.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, bytesForRead, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, empty, forFieldGroup, from, from, fromDirect, fromHexString, indexOf, indexOf, isClear, isEqual, readWrite, realCapacity, safeLimit, sharedMemory, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, valueOf, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite
addAndGetDouble, addAndGetDoubleNotAtomic, addAndGetFloat, addAndGetFloatNotAtomic, addAndGetInt, addAndGetIntNotAtomic, addAndGetLong, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, byteCheckSum, byteCheckSum, bytesForWrite, charAt, cipher, cipher, compareAndSwapDouble, compareAndSwapFloat, contentEquals, elasticByteBuffer, endsWith, equalBytes, forFields, from, hash, inside, inside, isEmpty, isEqual, isImmutableEmptyByteStore, lazyNativeBytesStoreWithFixedCapacity, length, nativePointer, nativeStore, nativeStoreFrom, nativeStoreWithFixedCapacity, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, writeMaxInt, writeMaxLong
append, append, write, write, writeBoolean, writeByte, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
bytesMethodReader, bytesMethodReaderBuilder, readObject
canReadDirect, canReadDirect, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
parse8bit, parse8bit, parse8bit, parse8bit, parse8bit, parseBigDecimal, parseBoolean, parseBoolean, parseDouble, parseFlexibleLong, parseFloat, parseInt, parseLong, parseLongDecimal, parseUtf8, parseUtf8, parseUtf8, reader, skipTo
inputStream, parseHexLong, parseUtf8, parseUtf8, rawReadByte, rawReadInt, rawReadLong, read, readChar, readIncompleteLong, readLimitToCapacity, readPositionForHeader, readUtf8, readUtf8, unsafeRead, unsafeReadObject, unsafeReadObject
bytesMethodWriter, writeObject
append, append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, canWriteDirect, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWrite, unsafeWriteObject, unsafeWriteObject, writeChar, writePositionForHeader
prepend
public static final long MASK
public static HexDumpBytes fromText(@NotNull @NotNull Reader reader) throws NumberFormatException
NumberFormatException
public static HexDumpBytes fromText(@NotNull @NotNull CharSequence text) throws NumberFormatException
NumberFormatException
public HexDumpBytes offsetFormat(OffsetFormat offsetFormat)
public int numberWrap()
public HexDumpBytes numberWrap(int numberWrap)
public long readRemaining()
If the resource is closed, the returned value is unspecified.
public long writeRemaining()
If the resource is closed, the returned value is unspecified.
public long readLimit()
If the resource is closed, the returned value is unspecified.
public long writeLimit()
If the resource is closed, the returned value is unspecified.
@NotNull public @NotNull String toHexString()
Bytes
toHexString
in interface Bytes<Void>
@NotNull public @NotNull String toString()
toString
in interface CharSequence
toString
in class Object
public boolean retainsComments()
BytesComment
retainsComments
in interface BytesComment<BytesOut<Void>>
public Bytes<Void> comment(@NotNull @NotNull CharSequence comment) throws IllegalStateException
BytesComment
comment
in interface BytesComment<BytesOut<Void>>
comment
- to add (or ignore)IllegalStateException
public BytesOut<Void> indent(int n) throws IllegalStateException
BytesComment
indent
in interface BytesComment<BytesOut<Void>>
n
- +1 indent in, -1 reduce indentingIllegalStateException
public BytesStore copy()
Bytes
RandomCommon.readPosition()
to RandomCommon.readLimit()
.public boolean isElastic()
Bytes
Bytes.realCapacity()
.public void ensureCapacity(long desiredCapacity) throws IllegalArgumentException, IllegalStateException
Bytes
DecoratedBufferOverflowException
ensureCapacity
in interface Bytes<Void>
desiredCapacity
- the capacity that you requiredIllegalStateException
- if closed and it needs a resizeIllegalArgumentException
@NotNull public @NotNull BytesStore bytesStore()
Bytes
bytesStore
in interface Bytes<Void>
bytesStore
in interface BytesStore<Bytes<Void>,Void>
@NotNull public @NotNull Bytes<Void> compact()
Bytes
@NotNull public @NotNull Bytes<Void> clear() throws IllegalStateException
StreamingCommon
clear
in interface Bytes<Void>
clear
in interface StreamingCommon<Bytes<Void>>
IllegalStateException
- if this resource has been previously releasedpublic boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<Void>,Void>
public long capacity()
capacity
in interface BytesStore<Bytes<Void>,Void>
public long addressForRead(long offset) throws UnsupportedOperationException, IllegalStateException, BufferUnderflowException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferUnderflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
public long addressForWrite(long offset) throws UnsupportedOperationException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heappublic long addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException
public boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
RandomDataInput
compareAndSwapInt
in interface BytesStore<Bytes<Void>,Void>
compareAndSwapInt
in interface RandomDataInput
compareAndSwapInt
in interface RandomDataOutput<Bytes<Void>>
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public void testAndSetInt(long offset, int expected, int value) throws IllegalStateException, BufferOverflowException
testAndSetInt
in interface RandomDataInput
testAndSetInt
in interface RandomDataOutput<Bytes<Void>>
IllegalStateException
BufferOverflowException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalStateException
RandomDataInput
compareAndSwapLong
in interface BytesStore<Bytes<Void>,Void>
compareAndSwapLong
in interface RandomDataInput
compareAndSwapLong
in interface RandomDataOutput<Bytes<Void>>
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
@Nullable public @Nullable Void underlyingObject()
underlyingObject
in interface BytesStore<Bytes<Void>,Void>
public void move(long from, long to, long length)
move
in interface BytesStore<Bytes<Void>,Void>
public void reserve(net.openhft.chronicle.core.io.ReferenceOwner owner) throws IllegalStateException
reserve
in interface net.openhft.chronicle.core.io.ReferenceCounted
IllegalStateException
public void release(net.openhft.chronicle.core.io.ReferenceOwner owner) throws IllegalStateException
release
in interface net.openhft.chronicle.core.io.ReferenceCounted
IllegalStateException
public void releaseLast(net.openhft.chronicle.core.io.ReferenceOwner owner) throws IllegalStateException
releaseLast
in interface net.openhft.chronicle.core.io.ReferenceCounted
IllegalStateException
public int refCount()
refCount
in interface net.openhft.chronicle.core.io.ReferenceCounted
public boolean tryReserve(net.openhft.chronicle.core.io.ReferenceOwner owner) throws IllegalStateException, IllegalArgumentException
tryReserve
in interface net.openhft.chronicle.core.io.ReferenceCounted
IllegalStateException
IllegalArgumentException
public boolean reservedBy(net.openhft.chronicle.core.io.ReferenceOwner owner) throws IllegalStateException
reservedBy
in interface net.openhft.chronicle.core.io.ReferenceCounted
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeByte(long offset, byte i8) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeByte
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi8
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeShort(long offset, short i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeShort
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeInt24(long offset, int i) throws BufferOverflowException, IllegalStateException
writeInt24
in interface RandomDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeInt(long offset, int i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeInt
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeOrderedInt(long offset, int i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeLong(long offset, long i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeLong
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeOrderedLong(long offset, long i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<Bytes<Void>>
offset
- to write toi
- value to writeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeFloat(long offset, float d) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeFloat
in interface RandomDataOutput<Bytes<Void>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeDouble(long offset, double d) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeDouble
in interface RandomDataOutput<Bytes<Void>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIllegalStateException
@NotNull public @NotNull Bytes<Void> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
writeVolatileByte
in interface RandomDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> writeVolatileShort(long offset, short i16) throws BufferOverflowException
writeVolatileShort
in interface RandomDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> writeVolatileInt(long offset, int i32) throws BufferOverflowException
writeVolatileInt
in interface RandomDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> writeVolatileLong(long offset, long i64) throws BufferOverflowException
writeVolatileLong
in interface RandomDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> write(long offsetInRDO, byte[] byteArray, int offset, int length)
RandomDataOutput
byteArray
to this Bytes object starting at writeOffset
taking
content starting at readOffset
but copying at most length
bytes.
Does not update cursors e.g. writePosition()
write
in interface RandomDataOutput<Bytes<Void>>
offsetInRDO
- non-negative offset to write tobyteArray
- non-null copy from byteArrayoffset
- non-negative copy from offsetlength
- non-negative length to copypublic void write(long offsetInRDO, @NotNull @NotNull ByteBuffer bytes, int offset, int length)
RandomDataOutput
Does not update cursors e.g. writePosition()
write
in interface RandomDataOutput<Bytes<Void>>
offsetInRDO
- offset to write tobytes
- copy from bytesoffset
- copy from offset@NotNull public @NotNull Bytes<Void> write(long writeOffset, @NotNull @NotNull RandomDataInput bytes, long readOffset, long length)
RandomDataOutput
writePosition()
nor RandomCommon.readPosition()
write
in interface RandomDataOutput<Bytes<Void>>
writeOffset
- offset to write tobytes
- copy from bytesreadOffset
- copy from offsetpublic long write8bit(long position, @NotNull @NotNull BytesStore bs)
RandomDataOutput
write8bit
in interface RandomDataOutput<Bytes<Void>>
position
- to writebs
- to copy.RandomDataOutput
public long write8bit(long position, @NotNull @NotNull String s, int start, int length)
write8bit
in interface RandomDataOutput<Bytes<Void>>
public void nativeWrite(long address, long position, long size)
RandomDataOutput
nativeWrite
in interface RandomDataOutput<Bytes<Void>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytes@NotNull public @NotNull Bytes<Void> zeroOut(long start, long end) throws IllegalStateException
BytesStore
zeroOut
in interface BytesStore<Bytes<Void>,Void>
zeroOut
in interface RandomDataOutput<Bytes<Void>>
start
- first byte inclusiveend
- last byte exclusiveIllegalStateException
@NotNull public @NotNull Bytes<Void> readPosition(long position) throws BufferUnderflowException, IllegalStateException
readPosition
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> readLimit(long limit) throws BufferUnderflowException
readLimit
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
@NotNull public @NotNull Bytes<Void> readSkip(long bytesToSkip) throws BufferUnderflowException, IllegalStateException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<Void>>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
public void uncheckedReadSkipOne()
StreamingDataInput
uncheckedReadSkipOne
in interface StreamingDataInput<Bytes<Void>>
public void uncheckedReadSkipBackOne()
StreamingDataInput
uncheckedReadSkipBackOne
in interface StreamingDataInput<Bytes<Void>>
public long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferUnderflowException
readStopBit
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
BufferUnderflowException
public char readStopBitChar() throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferUnderflowException
readStopBitChar
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
BufferUnderflowException
public double readStopBitDouble() throws IllegalStateException
readStopBitDouble
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public double readStopBitDecimal() throws IllegalStateException, BufferUnderflowException
readStopBitDecimal
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
BufferUnderflowException
public byte readByte() throws IllegalStateException
readByte
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public int readUnsignedByte() throws IllegalStateException
readUnsignedByte
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public int uncheckedReadUnsignedByte()
uncheckedReadUnsignedByte
in interface StreamingDataInput<Bytes<Void>>
public short readShort() throws BufferUnderflowException, IllegalStateException
readShort
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public int readInt() throws BufferUnderflowException, IllegalStateException
readInt
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public long readLong() throws BufferUnderflowException, IllegalStateException
readLong
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public float readFloat() throws BufferUnderflowException, IllegalStateException
readFloat
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public double readDouble() throws BufferUnderflowException, IllegalStateException
readDouble
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public int readVolatileInt() throws BufferUnderflowException, IllegalStateException
readVolatileInt
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public long readVolatileLong() throws BufferUnderflowException, IllegalStateException
readVolatileLong
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public int peekUnsignedByte() throws IllegalStateException
peekUnsignedByte
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public int lastDecimalPlaces()
lastDecimalPlaces
in interface ByteStringParser<Bytes<Void>>
public void lastDecimalPlaces(int lastDecimalPlaces)
ByteStringParser
lastDecimalPlaces
in interface ByteStringParser<Bytes<Void>>
lastDecimalPlaces
- set the number of decimal places if positive, otherwise 0.public boolean lastNumberHadDigits()
lastNumberHadDigits
in interface ByteStringParser<Bytes<Void>>
public void lastNumberHadDigits(boolean lastNumberHadDigits)
lastNumberHadDigits
in interface ByteStringParser<Bytes<Void>>
lastNumberHadDigits
- set the last number had digits@NotNull public @NotNull BigDecimal readBigDecimal() throws BufferUnderflowException, ArithmeticException, IllegalStateException
Bytes
If this Byte object is empty, an object equal to BigDecimal.ZERO
is returned.
readBigDecimal
in interface Bytes<Void>
BufferUnderflowException
- if the content of this Bytes object is insufficient to be successfully convertedArithmeticException
- if the content of this Bytes object could not be successfully convertedIllegalStateException
- if this Bytes object was previously released@NotNull public @NotNull BigInteger readBigInteger() throws BufferUnderflowException, ArithmeticException, IllegalStateException
Bytes
BigInteger.ZERO
if this Bytes object is empty.readBigInteger
in interface Bytes<Void>
BufferUnderflowException
- if the content of this Bytes object is insufficient to be successfully convertedArithmeticException
- if the content of this Bytes object could not be successfully convertedIllegalStateException
- if this Bytes object was previously releasedpublic void readWithLength(long length, @NotNull @NotNull BytesOut<Void> bytesOut) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferOverflowException
Bytes
bytesOut
writing the provided
length
bytes.
The readLimit and readPosition is not affected by this operation.
readWithLength
in interface Bytes<Void>
length
- indicating the number of bytes to writebytesOut
- non-null target to write the content of this Bytes object toBufferUnderflowException
- if the provided length
is greater than the remaining bytes readable.net.openhft.chronicle.core.io.IORuntimeException
- if there is an error reading or writing dataIllegalStateException
- if this Bytes object or the provided bytesOut
has been previously released.BufferOverflowException
- if the provided bytesOut
cannot hold the bytes to be writtenpublic <T extends ReadBytesMarshallable> T readMarshallableLength16(@NotNull @NotNull Class<T> clazz, @Nullable T using) throws BufferUnderflowException, IllegalStateException
Bytes
clazz
using the
provided using
, or if null
is provided for using
, creates a new object, eventually
returning whichever object was updated.
The content of this Bytes object is assumed to have a 16-bit length indicator preceding the actual object.
readMarshallableLength16
in interface Bytes<Void>
readMarshallableLength16
in interface BytesIn<Void>
T
- type of the provided usingclazz
- non-null type to readusing
- to update, nullableBufferUnderflowException
- if the content of this Bytes object is insufficient.IllegalStateException
- if this Bytes object or the provided bytesOut
has been previously released.Bytes.writeMarshallableLength16(WriteBytesMarshallable)
@NotNull public @NotNull Bytes<Void> readPositionUnlimited(long position) throws BufferUnderflowException, IllegalStateException
readPositionUnlimited
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> readPositionRemaining(long position, long remaining) throws BufferUnderflowException, IllegalStateException
readPositionRemaining
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public void readWithLength0(long length, @NotNull @NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<Bytes<Void>,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer, StringBuilder sb, BytesOut<?> toBytes) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
StreamingDataInput
readWithLength0
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
public void readWithLength(long length, @NotNull @NotNull net.openhft.chronicle.core.util.ThrowingConsumer<Bytes<Void>,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
StreamingDataInput
readWithLength
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
public boolean readBoolean() throws IllegalStateException
readBoolean
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public int readUnsignedShort() throws BufferUnderflowException, IllegalStateException
readUnsignedShort
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public int readInt24() throws BufferUnderflowException, IllegalStateException
readInt24
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public int readUnsignedInt24() throws BufferUnderflowException, IllegalStateException
readUnsignedInt24
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
public long readUnsignedInt() throws BufferUnderflowException, IllegalStateException
readUnsignedInt
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
@Nullable public @Nullable String readUtf8() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, ArithmeticException
StreamingDataInput
null
values are also supportedreadUtf8
in interface StreamingDataInput<Bytes<Void>>
null
if writeUtf8(null)
was calledBufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
ArithmeticException
@Nullable public @Nullable String read8bit() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException, ArithmeticException
read8bit
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
ArithmeticException
public <C extends Appendable & CharSequence> boolean readUtf8(@NotNull C sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException, IllegalStateException, ArithmeticException
StreamingDataInput
readUtf8
in interface StreamingDataInput<Bytes<Void>>
sb
- to copy chars totrue
if there was a String, or false
if it was null
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
IllegalStateException
ArithmeticException
public <C extends Appendable & CharSequence> long readUtf8(long offset, @NotNull C sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException, ArithmeticException, IllegalStateException
RandomDataInput
sb
(it must be a StringBuilder
or Bytes
) and reads a char
sequence from the given offset
, encoded as Utf8, into it. Returns offset after
the read Utf8, if a normal char sequence was read, or -1 - offset
, if null
was observed (in this case, sb
is truncated too, but not updated then, by querying
sb
only this case is indistinguishable from reading an empty char sequence).readUtf8
in interface RandomDataInput
C
- buffer type, must be StringBuilder
or Bytes
offset
- the offset in this RandomDataInput
to read char sequence fromsb
- the buffer to read char sequence into (truncated first)null
IllegalStateException
- if releasednet.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
ArithmeticException
RandomDataOutput.writeUtf8(long, CharSequence)
public <C extends Appendable & CharSequence> long readUtf8Limited(long offset, @NotNull C sb, int maxUtf8Len) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException, IllegalStateException
RandomDataInput
sb
(it must be a StringBuilder
or Bytes
) and reads a char
sequence from the given offset
, encoded as Utf8, into it. Returns offset after
the read Utf8, if a normal char sequence was read, or -1 - offset
, if null
was observed (in this case, sb
is truncated too, but not updated then, by querying
sb
only this case is indistinguishable from reading an empty char sequence). If
length of Utf8 encoding of the char sequence exceeds maxUtf8Len
,
IllegalStateException
is thrown.readUtf8Limited
in interface RandomDataInput
C
- buffer type, must be StringBuilder
or Bytes
offset
- the offset in this RandomDataInput
to read char sequence fromsb
- the buffer to read char sequence into (truncated first)maxUtf8Len
- the maximum allowed length of the char sequence in Utf8 encodingnull
IllegalStateException
- if releasednet.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
RandomDataOutput.writeUtf8Limited(long, CharSequence, int)
@Nullable public @Nullable String readUtf8Limited(long offset, int maxUtf8Len) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, IllegalStateException
RandomDataInput
offset
, encoded as Utf8. If length of Utf8
encoding of the char sequence exceeds maxUtf8Len
, IllegalStateException
is thrown.readUtf8Limited
in interface RandomDataInput
offset
- the offset in this RandomDataInput
to read char sequence frommaxUtf8Len
- the maximum allowed length of the char sequence in Utf8 encodingIllegalStateException
- if releasedBufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
RandomDataOutput.writeUtf8Limited(long, CharSequence, int)
public <C extends Appendable & CharSequence> boolean readUTFΔ(@NotNull C sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException, IllegalStateException, ArithmeticException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
IllegalStateException
ArithmeticException
public boolean read8bit(@NotNull @NotNull Bytes<?> b) throws BufferUnderflowException, IllegalStateException, BufferOverflowException, ArithmeticException
read8bit
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
BufferOverflowException
ArithmeticException
public boolean read8bit(@NotNull @NotNull StringBuilder sb) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, ArithmeticException, IllegalStateException
read8bit
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
ArithmeticException
IllegalStateException
public int read(byte[] bytes) throws IllegalStateException, BufferUnderflowException
read
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
BufferUnderflowException
public int read(byte[] bytes, int off, int len) throws IllegalStateException, BufferUnderflowException
read
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
BufferUnderflowException
public int read(char[] bytes, int off, int len) throws IllegalStateException
read
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public void read(@NotNull @NotNull ByteBuffer buffer) throws IllegalStateException
read
in interface StreamingDataInput<Bytes<Void>>
IllegalStateException
public void read(@NotNull @NotNull Bytes<?> bytes, int length) throws BufferUnderflowException, IllegalStateException, BufferOverflowException
read
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
BufferOverflowException
@NotNull public <E extends Enum<E>> E readEnum(@NotNull @NotNull Class<E> eClass) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException, ArithmeticException, BufferOverflowException
readEnum
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
ArithmeticException
BufferOverflowException
public void readHistogram(@NotNull @NotNull net.openhft.chronicle.core.util.Histogram histogram) throws BufferUnderflowException, IllegalStateException, ArithmeticException
readHistogram
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
ArithmeticException
public void readWithLength(@NotNull @NotNull Bytes<?> bytes) throws ArithmeticException, BufferOverflowException, IllegalStateException, BufferUnderflowException
readWithLength
in interface StreamingDataInput<Bytes<Void>>
ArithmeticException
BufferOverflowException
IllegalStateException
BufferUnderflowException
@NotNull public @NotNull Bytes<Void> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> writeLimit(long limit) throws BufferOverflowException
writeLimit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> writeSkip(long bytesToSkip) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Void>>
bytesToSkip
- bytes to skip. This can be negative.BufferOverflowException
- if the offset is outside the limits of the BytesIllegalStateException
@NotNull public @NotNull Bytes<Void> writeByte(byte i8) throws BufferOverflowException, IllegalStateException
writeByte
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
public long writePosition()
public long lengthWritten(long startPosition)
If the resource is closed, the returned value is unspecified.
startPosition
- to compare against@NotNull public @NotNull Bytes<Void> writeShort(short i16) throws BufferOverflowException, IllegalStateException
writeShort
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeInt(int i) throws BufferOverflowException, IllegalStateException
writeInt
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeIntAdv(int i, int advance) throws BufferOverflowException, IllegalStateException
writeIntAdv
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeLong(long i64) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeLong
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeLongAdv(long i64, int advance) throws BufferOverflowException, IllegalStateException
writeLongAdv
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeFloat(float f) throws BufferOverflowException, IllegalStateException
writeFloat
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeDouble(double d) throws BufferOverflowException, IllegalStateException
writeDouble
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeDoubleAndInt(double d, int i) throws BufferOverflowException, IllegalStateException
writeDoubleAndInt
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> write(byte[] byteArray, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
StreamingDataOutput
byteArray
into this Bytes object.
Invoking this method will update the cursors of this Bytes object.
write
in interface StreamingDataOutput<Bytes<Void>>
IllegalArgumentException
- if the provided offset
or length
is negativeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeSome(@NotNull @NotNull ByteBuffer buffer) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
StreamingDataOutput
Calling this method will update the cursors of this.
writeSome
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
@NotNull public @NotNull Bytes<Void> writeOrderedInt(int i) throws BufferOverflowException, IllegalStateException
writeOrderedInt
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeOrderedLong(long i) throws BufferOverflowException, IllegalStateException
writeOrderedLong
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> clearAndPad(long length) throws BufferOverflowException, IllegalStateException
BytesPrepender
clearAndPad
in interface BytesPrepender<Bytes<Void>>
length
- to padBufferOverflowException
- if the length > capacity() - start()IllegalStateException
@NotNull public @NotNull Bytes<Void> prewrite(byte[] bytes)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Void>>
bytes
- to prepend to.@NotNull public @NotNull Bytes<Void> prewrite(BytesStore bytes)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Void>>
bytes
- to prepend to.@NotNull public @NotNull Bytes<Void> prewriteByte(byte b)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteByte
in interface BytesPrepender<Bytes<Void>>
b
- byte to prepend to.@NotNull public @NotNull Bytes<Void> prewriteShort(short i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteShort
in interface BytesPrepender<Bytes<Void>>
i
- short to prepend to.@NotNull public @NotNull Bytes<Void> prewriteInt(int i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteInt
in interface BytesPrepender<Bytes<Void>>
i
- integer to prepend to.@NotNull public @NotNull Bytes<Void> prewriteLong(long l)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteLong
in interface BytesPrepender<Bytes<Void>>
l
- long to prepend to.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
- if releasedpublic int peekUnsignedByte(long offset) throws IllegalStateException, BufferUnderflowException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- to readIllegalStateException
- if releasedBufferUnderflowException
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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic 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
- if releasedpublic long readPosition()
The read position is start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
If the resource is closed, the returned value is unspecified.
public void lenient(boolean lenient)
StreamingDataInput
false
and empty string.lenient
in interface StreamingDataInput<Bytes<Void>>
lenient
- if true, return nothing rather than error.public boolean lenient()
lenient
in interface StreamingDataInput<Bytes<Void>>
public void writeMarshallableLength16(@NotNull @NotNull WriteBytesMarshallable marshallable) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IllegalStateException
Bytes
marshallable
to this Bytes object converting from an object
to a number of bytes.
The content of this Bytes object will have a 16-bit length indicator preceding the actual object.
writeMarshallableLength16
in interface Bytes<Void>
writeMarshallableLength16
in interface BytesOut<Void>
marshallable
- non-null object to write to this Bytes objectBufferOverflowException
- if the capacity of this Bytes object is insufficient.IllegalStateException
- if this Bytes object or the provided bytesOut
has been previously released
or if the contents of this Bytes object cannot fit under 16-bit addressingIllegalArgumentException
BufferUnderflowException
Bytes.readMarshallableLength16(Class, ReadBytesMarshallable)
public Bytes<?> write(@NotNull @NotNull InputStream inputStream) throws IOException, IllegalStateException, BufferOverflowException
Bytes
write
in interface Bytes<Void>
inputStream
- non-null to read fromIOException
- if an I/O error occur on the inputStreamIllegalStateException
- if this Bytes object or the provided bytesOut
has been previously releasedBufferOverflowException
- if this Bytes object lacks capacity to write the entire provided inputStream
@NotNull public @NotNull Bytes<Void> writeStopBit(long x) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
x
- long to writeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeStopBit(char x) throws BufferOverflowException, IllegalStateException
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeStopBit(double d) throws BufferOverflowException, IllegalStateException
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeStopBitDecimal(double d) throws BufferOverflowException, IllegalStateException
writeStopBitDecimal
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeUtf8(@Nullable @Nullable CharSequence text) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
writeUTF
with the following changes. 1) The length is stop bit encoded
i.e. one byte longer for short strings, but is not limited in length. 2) The string can be null.writeUtf8
in interface StreamingDataOutput<Bytes<Void>>
text
- the string value to be written. Can be null.BufferOverflowException
- if there is not enough space leftIllegalStateException
IllegalArgumentException
@NotNull public @NotNull Bytes<Void> writeUtf8(@Nullable @Nullable String text) throws BufferOverflowException, IllegalStateException
writeUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> write8bit(@Nullable @Nullable CharSequence text) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, ArithmeticException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
ArithmeticException
@NotNull public @NotNull Bytes<Void> write8bit(@NotNull @NotNull CharSequence text, int start, int length) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException, BufferUnderflowException, ArithmeticException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IndexOutOfBoundsException
IllegalStateException
BufferUnderflowException
ArithmeticException
@NotNull public @NotNull Bytes<Void> write8bit(@NotNull @NotNull String text, int start, int length) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException, BufferUnderflowException, ArithmeticException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IndexOutOfBoundsException
IllegalStateException
BufferUnderflowException
ArithmeticException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull CharSequence text) throws BufferOverflowException, IllegalStateException, IndexOutOfBoundsException
StreamingDataOutput
text
to this StreamingDataOutput at the current writePosition().write
in interface StreamingDataOutput<Bytes<Void>>
text
- to writeBufferOverflowException
- if the provided text
cannot be accommodated.IllegalStateException
- if this StreamingDataOutput has been previously released.IndexOutOfBoundsException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull CharSequence text, int startText, int length) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException
StreamingDataOutput
text
to this StreamingDataOutput at the current writePosition()write
in interface StreamingDataOutput<Bytes<Void>>
text
- to writestartText
- offset from where text should be copied fromlength
- number of characters to write.BufferOverflowException
- if the provided text
cannot be accommodated.IllegalStateException
- if this StreamingDataOutput has been previously released.IndexOutOfBoundsException
@NotNull public @NotNull Bytes<Void> write8bit(@Nullable @Nullable String s) throws BufferOverflowException, IllegalStateException, ArithmeticException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Void> write8bit(@Nullable @Nullable BytesStore bs) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
@NotNull public @NotNull Bytes<Void> writeUnsignedByte(int i) throws BufferOverflowException, IllegalStateException, ArithmeticException
writeUnsignedByte
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Void> writeUnsignedShort(int u16) throws BufferOverflowException, IllegalStateException, ArithmeticException
writeUnsignedShort
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Void> writeInt24(int i) throws BufferOverflowException, IllegalStateException, ArithmeticException
writeInt24
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Void> writeUnsignedInt24(int i) throws BufferOverflowException, IllegalStateException, ArithmeticException
writeUnsignedInt24
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
@NotNull public @NotNull Bytes<Void> writeUnsignedInt(long i) throws BufferOverflowException, ArithmeticException, IllegalStateException
writeUnsignedInt
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
ArithmeticException
IllegalStateException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull RandomDataInput bytes) throws IllegalStateException, BufferOverflowException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<Void>>
IllegalStateException
BufferOverflowException
public Bytes<Void> write(@NotNull @NotNull BytesStore<?,?> bytes) throws IllegalStateException, BufferOverflowException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<Void>>
bytes
- to writeIllegalStateException
BufferOverflowException
StreamingDataInput.read(Bytes)
@NotNull public @NotNull Bytes<Void> writeSome(@NotNull @NotNull Bytes<?> bytes) throws IllegalStateException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
writeSome
in interface StreamingDataOutput<Bytes<Void>>
IllegalStateException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
BufferUnderflowException
IllegalStateException
IllegalArgumentException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
BufferUnderflowException
IllegalStateException
IllegalArgumentException
@NotNull public @NotNull Bytes<Void> write(byte[] byteArray) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
Calling this method will update the cursors of this.
write
in interface StreamingDataOutput<Bytes<Void>>
byteArray
- to writeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeBoolean(boolean flag) throws BufferOverflowException, IllegalStateException
writeBoolean
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
public <E extends Enum<E>> Bytes<Void> writeEnum(@NotNull E e) throws BufferOverflowException, IllegalStateException, ArithmeticException
writeEnum
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
ArithmeticException
public void writePositionRemaining(long position, long length) throws BufferOverflowException
writePositionRemaining
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
public void writeHistogram(@NotNull @NotNull net.openhft.chronicle.core.util.Histogram histogram) throws IllegalStateException, BufferOverflowException
writeHistogram
in interface StreamingDataOutput<Bytes<Void>>
IllegalStateException
BufferOverflowException
public void writeBigDecimal(@NotNull @NotNull BigDecimal bd) throws IllegalArgumentException, IllegalStateException, BufferOverflowException
writeBigDecimal
in interface StreamingDataOutput<Bytes<Void>>
IllegalArgumentException
IllegalStateException
BufferOverflowException
public void writeBigInteger(@NotNull @NotNull BigInteger bi) throws IllegalArgumentException, IllegalStateException, BufferOverflowException
writeBigInteger
in interface StreamingDataOutput<Bytes<Void>>
IllegalArgumentException
IllegalStateException
BufferOverflowException
public void writeWithLength(@NotNull @NotNull RandomDataInput bytes) throws IllegalStateException, BufferOverflowException
writeWithLength
in interface StreamingDataOutput<Bytes<Void>>
IllegalStateException
BufferOverflowException
public void singleThreadedCheckReset()
singleThreadedCheckReset
in interface net.openhft.chronicle.core.io.SingleThreadedChecked
public void singleThreadedCheckDisabled(boolean singleThreadedCheckDisabled)
singleThreadedCheckDisabled
in interface net.openhft.chronicle.core.io.SingleThreadedChecked
Copyright © 2022. All rights reserved.