U
- the type of the BytesOutpublic interface BytesOut<U> extends StreamingDataOutput<Bytes<U>>, ByteStringAppender<Bytes<U>>, BytesPrepender<Bytes<U>>, HexDumpBytesDescription<BytesOut<U>>
StreamingDataOutput
, ByteStringAppender
,
BytesPrepender
, and HexDumpBytesDescription
, thus providing a
wide range of operations for handling byte data, including appending, prepending,
and producing a hex dump description.
Note: This interface suppresses rawtypes and unchecked warnings.
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Retrieves the underlying memory address for reading.
|
default long |
addressForRead(long offset,
int buffer)
Retrieves the underlying memory address for reading.
|
long |
addressForWrite(long offset)
Retrieves the underlying memory address for writing.
|
long |
addressForWritePosition()
Retrieves the underlying memory address for writing at the current write position.
|
default ByteOrder |
byteOrder()
Retrieves the byte order used by the buffer.
|
@NotNull Bytes<?> |
bytesForRead()
Retrieves a Bytes object for reading.
|
@NotNull Bytes<?> |
bytesForWrite()
Retrieves a Bytes object for writing.
|
default <T> T |
bytesMethodWriter(@NotNull Class<T> tClass,
Class... additional)
Creates a proxy for the provided interface(s), such that each method invocation on the proxy
is written to this
BytesOut instance for replay. |
default long |
capacity() |
boolean |
isDirectMemory()
Checks if the buffer uses direct memory.
|
default long |
lengthWritten(long startPosition)
Calculates the length of data written from the given start position.
|
default long |
readLimit()
If the resource is closed, the returned value is unspecified.
|
default long |
readPosition()
Returns the read position.
|
default long |
readRemaining()
Calculates the number of bytes remaining that can be read from the current read position.
|
default long |
realReadRemaining()
Calculates the number of bytes that can be safely read directly.
|
default long |
realWriteRemaining()
Calculates the number of bytes remaining that can be written from the current write position with resizing.
|
boolean |
sharedMemory()
Checks if the Bytes use shared memory.
|
default long |
start() |
default long |
writeLimit()
Retrieves the maximum writable position within the buffer.
|
void |
writeMarshallableLength16(WriteBytesMarshallable marshallable)
Writes a
WriteBytesMarshallable to this BytesOut instance. |
default void |
writeObject(Class componentType,
Object obj)
Writes an object of a given type to this
BytesOut instance. |
default long |
writePosition()
Returns the write position.
|
default long |
writeRemaining()
Calculates the number of bytes remaining that can be written from the current write position.
|
append, append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, decimaliser, decimaliser, fpAppend0, fpAppend0, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, canWriteDirect, copyFrom, ensureCapacity, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, realCapacity, unsafeWrite, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeByte, writeChar, writeDouble, writeDoubleAndInt, writeEnum, writeFloat, writeHistogram, writeInt, writeInt24, writeIntAdv, writeLimit, writeLong, writeLongAdv, writeOrderedInt, writeOrderedLong, writePosition, writePositionForHeader, writePositionRemaining, writeShort, writeSkip, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeWithLength
clear
addReferenceChangeListener, refCount, release, releaseLast, releaseLast, removeReferenceChangeListener, reserve, reserveTransfer, tryReserve
referenceId, referenceName, temporary
clearAndPad, prepend, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteShort
adjustHexDumpIndentation, retainedHexDumpDescription, writeHexDumpDescription
@NotNull default <T> T bytesMethodWriter(@NotNull @NotNull Class<T> tClass, Class... additional) throws IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException
BytesOut
instance for replay.tClass
- the primary interface to be proxied.additional
- any additional interfaces to be proxied.IllegalArgumentException
- If an argument is inappropriateNullPointerException
- If the provided tClass
is null
net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.void writeMarshallableLength16(WriteBytesMarshallable marshallable) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, net.openhft.chronicle.core.io.InvalidMarshallableException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
WriteBytesMarshallable
to this BytesOut
instance.marshallable
- the object to be written.IllegalArgumentException
- If a method is invoked with an illegal or inappropriate argument.BufferOverflowException
- If there is not enough space in the buffer.BufferUnderflowException
- If there is not enough data available in the buffer.net.openhft.chronicle.core.io.InvalidMarshallableException
- If the object cannot be written due to invalid data.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe way.default void writeObject(Class componentType, Object obj) throws IllegalArgumentException, BufferOverflowException, ArithmeticException, net.openhft.chronicle.core.io.ClosedIllegalStateException, BufferUnderflowException, net.openhft.chronicle.core.io.InvalidMarshallableException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
BytesOut
instance.
This method supports a limited set of writeObject types.componentType
- the expected type of the object.obj
- the object to be written.IllegalArgumentException
- If a method is invoked with an illegal or inappropriate argument.BufferOverflowException
- If there is not enough space in the buffer.ArithmeticException
- If there is an arithmetic error.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe way.BufferUnderflowException
- If there is not enough data available in the buffer.net.openhft.chronicle.core.io.InvalidMarshallableException
- If the object cannot be written due to invalid data.default long start()
default long capacity()
default long readPosition()
The read position is start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
If the resource is closed, the returned value is unspecified.
default long writePosition()
The write position is readPosition() <= writePosition() && writePosition() <= writeLimit()
If the resource is closed, the returned value is unspecified.
default long lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
If the resource is closed, the returned value is unspecified.
startPosition
- The position to calculate the length from.default long readRemaining()
If the resource is closed, the returned value is unspecified.
default long realReadRemaining()
If the resource is closed, the returned value is unspecified.
default long writeRemaining()
If the resource is closed, the returned value is unspecified.
default long realWriteRemaining()
If the resource is closed, the returned value is unspecified.
default long readLimit()
If the resource is closed, the returned value is unspecified.
default long writeLimit()
If the resource is closed, the returned value is unspecified.
long addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
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()net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe waydefault long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
offset
- The offset within this buffer.buffer
- The buffer index.UnsupportedOperationException
- If the underlying buffer is on the heap.BufferUnderflowException
- If the offset is before the start or after the capacity.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe waylong addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- If the underlying buffer is on the heapBufferOverflowException
- If the offset is before the start() or the after the capacity()net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe waylong addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException
UnsupportedOperationException
- If the underlying buffer is on the heap.BufferOverflowException
- If the current write position is before the start or after the capacity.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe waydefault ByteOrder byteOrder()
@NotNull @NotNull Bytes<?> bytesForRead() throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe way@NotNull @NotNull Bytes<?> bytesForWrite() throws net.openhft.chronicle.core.io.ClosedIllegalStateException
net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayboolean sharedMemory()
boolean isDirectMemory()
Copyright © 2023. All rights reserved.