public class RawWire extends AbstractWire implements Wire
RawWire class is specifically designed for efficient binary serialization
where headers and other metadata might not be necessary.WireIn.HeaderTypeWireOut.EndOfWirebytes, classLookup, commentListener, DEFAULT_USE_PADDING, parent, use8bitMARSHALLABLE_IN_INTERN_SIZE| Constructor and Description |
|---|
RawWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes) |
RawWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean use8bit) |
| Modifier and Type | Method and Description |
|---|---|
DocumentContext |
acquireWritingDocument(boolean metaData)
Retrieves a context for writing either data or metadata, reusing an existing context if available.
|
@NotNull WireOut |
addPadding(int paddingToAdd)
Adds padding to the wire.
|
@NotNull net.openhft.chronicle.bytes.Bytes<?> |
bytes()
Returns the underlying
Bytes stored by the wire. |
void |
clear()
Clears the WireIn, effectively resetting its state.
|
void |
consumePadding()
Consumes and discards any padding that may exist between the current read position and the next piece of meaningful data.
|
void |
copyTo(@NotNull WireOut wire)
Copies the content from the current WireIn source to the provided WireOut destination.
|
@NotNull ValueIn |
getValueIn()
Obtains the value associated with a field or event for more advanced use cases.
|
@NotNull ValueOut |
getValueOut()
Retrieves the interface for defining the output of a value
that will be written to the stream.
|
boolean |
isBinary()
Determine whether direct access to the underlying byte() makes sense or should it be treated as text
|
@NotNull net.openhft.chronicle.core.values.BooleanValue |
newBooleanReference()
Creates and returns a new
BooleanValue. |
@NotNull net.openhft.chronicle.core.values.IntArrayValues |
newIntArrayReference()
Creates and returns a new
IntArrayValues. |
@NotNull net.openhft.chronicle.core.values.IntValue |
newIntReference()
Creates and returns a new
IntValue. |
@NotNull net.openhft.chronicle.bytes.ref.BinaryLongArrayReference |
newLongArrayReference()
Creates and returns a new
LongArrayValues. |
@NotNull net.openhft.chronicle.core.values.LongValue |
newLongReference()
Creates and returns a new
LongValue. |
@NotNull ValueIn |
read()
Reads the next field if present, or returns an empty string if not present.
|
@NotNull ValueIn |
read(@NotNull StringBuilder name)
Reads a specific field based on the provided field name.
|
@NotNull ValueIn |
read(@NotNull WireKey key)
Reads the next field if present.
|
@NotNull WireIn |
readAlignTo(int alignment)
Adjusts the read position of the WireIn to align with the specified boundary.
|
@NotNull Wire |
readComment(@NotNull StringBuilder sb)
Reads a comment from the Wire data and appends it to the provided StringBuilder.
|
<K> K |
readEvent(@NotNull Class<K> expectedClass)
Reads a field which may contain an object of any specified type.
|
@NotNull ValueIn |
readEventName(@NotNull StringBuilder name)
Reads a field or string, ensuring the value is always read.
|
@NotNull DocumentContext |
readingDocument()
equivalent to
WireIn.readDocument(net.openhft.chronicle.wire.ReadMarshallable,
net.openhft.chronicle.wire.ReadMarshallable) but with out the use of a lambda expression |
@NotNull DocumentContext |
readingDocument(long readLocation)
Provides a context for reading a document starting at a specific position.
|
@NotNull String |
readingPeekYaml()
Peeks at the content in the current WireIn instance and returns it as a YAML string.
|
void |
reset()
Reset the state of the wire
|
String |
toString() |
boolean |
useSelfDescribingMessage(@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
Should this wire write the object as a Marshallable or BytesMarshallable
|
@NotNull ValueOut |
write()
Writes an empty field marker to the stream.
|
@NotNull ValueOut |
write(@NotNull CharSequence name)
Writes a CharSequence key to the stream.
|
@NotNull ValueOut |
write(@NotNull WireKey key)
Writes a WireKey to the stream.
|
@NotNull Wire |
writeComment(CharSequence s)
Writes a comment to the wire.
|
void |
writeEndEvent() |
@NotNull ValueOut |
writeEventName(@NotNull CharSequence name)
Writes a CharSequence key to the stream.
|
@NotNull ValueOut |
writeEventName(@NotNull WireKey key)
Writes a key to the stream.
|
void |
writeStartEvent()
Start an event object, mostly for internal use.
|
@NotNull DocumentContext |
writingDocument(boolean metaData)
Starts the process of writing a document to the wire with an option for metadata.
|
bytesComment, classLookup, classLookup, commentListener, endOfWire, enterHeader, forceNotInsideHeader, headerNumber, headerNumber, headNumberCheck, isInsideHeader, notCompleteIsNotPresent, notCompleteIsNotPresent, objectInput, objectOutput, parent, parent, pauser, pauser, readAndSetLength, readDataHeader, readEventNumber, readFirstHeader, readFirstHeader, readMetaDataHeader, updateFirstHeader, updateFirstHeader, updateHeader, usePadding, usePadding, writeEndOfWire, writeFirstHeaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitheaderNumber, newYamlWireOnHeapcommentListener, endEvent, hasMetaDataPrefix, hasMore, hintReadInputOrder, isEmpty, isEndEvent, isNotEmptyAfterPadding, objectInput, rawReadData, read, readAllAsMap, readAndSetLength, readDataHeader, readDataHeader, readDocument, readDocument, readEventNumber, readFirstHeader, readFirstHeader, readMetaDataHeader, startEventmethodReader, methodReaderBuilder, readBytes, readBytes, readDocument, readMap, readText, readTextdropDefault, endOfWire, enterHeader, objectOutput, padToCacheAlign, updateFirstHeader, updateFirstHeader, updateHeader, writeAlignTo, writeAllAsMap, writeDocument, writeEndOfWire, writeEvent, writeEventId, writeEventId, writeFirstHeader, writeNotCompleteDocument, writingDocument, writingIsCompletebytesComment, classLookup, classLookup, headerNumber, newTwoLongReference, notCompleteIsNotPresent, notCompleteIsNotPresent, parent, parent, pauser, pauser, usePadding, usePaddingbuilder, methodWriter, methodWriterBuilder, methodWriterBuilder, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeTextrollbackIfNotCompletepublic RawWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
public RawWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean use8bit)
public void reset()
WireCommonreset in interface WireCommonpublic boolean isBinary()
WireCommonisBinary in interface WireCommon@NotNull public @NotNull DocumentContext writingDocument(boolean metaData)
WireOutwritingDocument in interface DocumentWrittenwritingDocument in interface MarshallableOutwritingDocument in interface WireOutmetaData - If true, the returned document context will be used for writing metadata.public DocumentContext acquireWritingDocument(boolean metaData)
WireOutacquireWritingDocument in interface DocumentWrittenacquireWritingDocument in interface MarshallableOutacquireWritingDocument in interface WireOutmetaData - If true, the returned context will be used for writing metadata.@NotNull public @NotNull DocumentContext readingDocument()
WireInWireIn.readDocument(net.openhft.chronicle.wire.ReadMarshallable,
net.openhft.chronicle.wire.ReadMarshallable) but with out the use of a lambda expressionreadingDocument in interface MarshallableInreadingDocument in interface WireIn@NotNull public @NotNull DocumentContext readingDocument(long readLocation)
WireInreadingDocument in interface WireInreadLocation - The position from which to start reading the document.public void consumePadding()
WireInconsumePadding in interface WireIn@NotNull public @NotNull String readingPeekYaml()
WireInreadingPeekYaml in interface WireInpublic void copyTo(@NotNull
@NotNull WireOut wire)
WireIn@NotNull public @NotNull ValueIn read()
WireIn@NotNull public @NotNull ValueIn read(@NotNull @NotNull WireKey key)
WireInWireKey.@NotNull public @NotNull ValueIn readEventName(@NotNull @NotNull StringBuilder name)
WireInreadEventName in interface WireInname - The StringBuilder that holds the name of the field or string.ValueIn instance.@Nullable
public <K> K readEvent(@NotNull
@NotNull Class<K> expectedClass)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
WireInreadEvent in interface WireInK - The type of object expected.expectedClass - The class type hint of the expected object. If no hint is available, use Object.class.net.openhft.chronicle.core.io.InvalidMarshallableException - If there's an error in the marshalling process.@NotNull public @NotNull ValueIn read(@NotNull @NotNull StringBuilder name)
WireIn@NotNull public @NotNull ValueIn getValueIn()
WireInWireIn.readEvent(Class).getValueIn in interface WireInValueIn instance.@NotNull public @NotNull Wire readComment(@NotNull @NotNull StringBuilder sb)
WireInreadComment in interface WireInsb - StringBuilder to which the comment will be appended.public void clear()
WireInclear in interface WireCommonclear in interface WireInclear in interface WireOutclear in class AbstractWire@NotNull public @NotNull net.openhft.chronicle.core.values.BooleanValue newBooleanReference()
WireCommonBooleanValue. The BooleanValue implementation that is
returned depends on the wire implementation.newBooleanReference in interface WireCommonBooleanValue.public boolean useSelfDescribingMessage(@NotNull
@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
WireCommonuseSelfDescribingMessage in interface WireCommon@NotNull public @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes()
WireCommonBytes stored by the wire.bytes in interface WireCommonbytes in class AbstractWireBytes stored by the wire@NotNull public @NotNull WireIn readAlignTo(int alignment)
WireInreadAlignTo in interface WireInalignment - The byte boundary to which the read position should align.@NotNull public @NotNull ValueOut write()
WireOut@NotNull public @NotNull ValueOut writeEventName(@NotNull @NotNull WireKey key)
WireOutwriteEventName in interface WireOutkey - The key to write to the stream.@NotNull public @NotNull ValueOut writeEventName(@NotNull @NotNull CharSequence name)
WireOutwriteEventName in interface WireOutname - The CharSequence key to write to the stream.public void writeStartEvent()
WireOutwriteStartEvent in interface WireOutpublic void writeEndEvent()
writeEndEvent in interface WireOut@NotNull public @NotNull ValueOut write(@NotNull @NotNull WireKey key)
WireOut@NotNull public @NotNull ValueOut write(@NotNull @NotNull CharSequence name)
WireOut@NotNull public @NotNull ValueOut getValueOut()
WireOutgetValueOut in interface WireOut@NotNull public @NotNull Wire writeComment(CharSequence s)
WireOutwriteComment in interface WireOuts - The comment to be written to the stream.@NotNull public @NotNull WireOut addPadding(int paddingToAdd)
WireOutaddPadding in interface WireOutpaddingToAdd - The amount of padding to add.@NotNull public @NotNull net.openhft.chronicle.core.values.LongValue newLongReference()
WireCommonLongValue. The LongValue implementation that is
returned depends on the wire implementation.newLongReference in interface WireCommonLongValue@NotNull public @NotNull net.openhft.chronicle.core.values.IntValue newIntReference()
WireCommonIntValue. The IntValue implementation that is
returned depends on the wire implementation.newIntReference in interface WireCommonIntValue.@NotNull public @NotNull net.openhft.chronicle.bytes.ref.BinaryLongArrayReference newLongArrayReference()
WireCommonLongArrayValues. The LongArrayValues implementation that
is returned depends on the wire implementation.newLongArrayReference in interface WireCommonLongArrayValues@NotNull public @NotNull net.openhft.chronicle.core.values.IntArrayValues newIntArrayReference()
WireCommonIntArrayValues. The IntArrayValues implementation that
is returned depends on the wire implementation.newIntArrayReference in interface WireCommonIntArrayValuesCopyright © 2024. All rights reserved.