public class BinaryWire extends AbstractWire implements Wire
| Modifier and Type | Class and Description |
|---|---|
protected class |
BinaryWire.BinaryValueIn |
protected class |
BinaryWire.BinaryValueOut |
protected class |
BinaryWire.FixedBinaryValueOut |
WireIn.HeaderTypeWireOut.EndOfWire| Modifier and Type | Field and Description |
|---|---|
protected @NotNull BinaryWire.BinaryValueIn |
valueIn |
bytes, classLookup, commentListener, DEFAULT_USE_PADDING, parent, use8bitMARSHALLABLE_IN_INTERN_SIZE| Constructor and Description |
|---|
BinaryWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes) |
BinaryWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean fixed,
boolean numericFields,
boolean fieldLess,
int compressedSize,
String compression,
boolean supportDelta) |
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull StringBuilder |
acquireStringBuilder() |
DocumentContext |
acquireWritingDocument(boolean metaData)
Start or reuse an existing a DocumentContext, optionally call close() when done.
|
@NotNull WireOut |
addPadding(int paddingToAdd) |
protected void |
anchor(@NotNull WireOut wire) |
static @NotNull BinaryWire |
binaryOnly(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes) |
void |
clear()
Resets the state of the underlying
Bytes stored by the wire. |
void |
consumePadding() |
void |
copyOne(@NotNull WireOut wire) |
void |
copyTo(@NotNull WireOut wire) |
protected void |
fieldAnchor(@NotNull WireOut wire) |
boolean |
fieldLess() |
protected @NotNull BinaryWire.BinaryValueIn |
getBinaryValueIn() |
protected @NotNull BinaryWire.FixedBinaryValueOut |
getFixedBinaryValueOut(boolean fixed) |
Boolean |
getOverrideSelfDescribing() |
@NotNull ValueIn |
getValueIn()
Obtain the value in for advanced use (typically after a call to readEvent above)
|
@NotNull ValueOut |
getValueOut()
Obtain the value out
|
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 net.openhft.chronicle.core.values.TwoLongValue |
newTwoLongReference()
Creates and returns a new
TwoLongValue. |
protected int |
peekCode() |
@NotNull ValueIn |
read()
Read the field if present, or empty string if not present.
|
@NotNull ValueIn |
read(@NotNull String fieldName) |
@NotNull ValueIn |
read(@NotNull StringBuilder name)
Read the field if present, or empty string if not present.
|
@NotNull ValueIn |
read(@NotNull WireKey key)
Read the field if present which must match the WireKey.
|
protected <T> ValueIn |
read2(CharSequence keyName,
int keyCode,
T defaultSource,
@NotNull Function<T,Object> defaultLookup,
@NotNull net.openhft.chronicle.wire.ValueInState curr,
@NotNull StringBuilder sb,
CharSequence name) |
@NotNull Wire |
readComment(@NotNull StringBuilder s) |
<K> K |
readEvent(@NotNull Class<K> expectedClass)
Read a field which might be an object of any type.
|
@NotNull ValueIn |
readEventName(@NotNull StringBuilder name)
Read a field, or string which is always written, even for formats which might drop the field
such as RAW.
|
long |
readEventNumber() |
protected @NotNull StringBuilder |
readFieldAnchor(@NotNull StringBuilder sb) |
protected @NotNull StringBuilder |
readFieldNumber(CharSequence keyName,
int keyCode,
@NotNull StringBuilder sb,
long fieldId) |
@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) |
@NotNull String |
readingPeekYaml()
Typicality used for debugging, this method does not progress the read position and should
only be used when inside a reading document.
|
void |
readWithLength(@NotNull WireOut wire,
int len) |
void |
reset()
Reset the state of the wire
|
BinaryWire |
setOverrideSelfDescribing(Boolean overrideSelfDescribing) |
@NotNull String |
toString() |
protected static void |
unexpectedCode() |
protected void |
unknownCode(@NotNull WireOut wire) |
boolean |
useSelfDescribingMessage(@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
Should this wire write the object as a Marshallable or BytesMarshallable
|
@NotNull ValueOut |
write()
Write an empty filed marker
|
@NotNull ValueOut |
write(@NotNull CharSequence key) |
@NotNull ValueOut |
write(@NotNull WireKey key)
Write a key for wires that support fields.
|
protected net.openhft.chronicle.bytes.Bytes<?> |
writeCode(int code) |
@NotNull Wire |
writeComment(CharSequence s) |
void |
writeEndEvent() |
ValueOut |
writeEventId(int methodId) |
ValueOut |
writeEventId(String name,
int methodId) |
@NotNull ValueOut |
writeEventName(@NotNull CharSequence name) |
@NotNull ValueOut |
writeEventName(@NotNull WireKey key)
Always write a key.
|
void |
writeStartEvent()
Start an event object, mostly for internal use.
|
@NotNull DocumentContext |
writingDocument(boolean metaData)
This will increment the headerNumber as appropriate if successful
|
boolean |
writingIsComplete() |
bytes, bytesComment, classLookup, classLookup, commentListener, endOfWire, enterHeader, forceNotInsideHeader, headerNumber, headerNumber, headNumberCheck, isInsideHeader, notCompleteIsNotPresent, notCompleteIsNotPresent, objectInput, objectOutput, parent, parent, pauser, pauser, readAndSetLength, readDataHeader, readFirstHeader, readFirstHeader, readMetaDataHeader, updateFirstHeader, updateFirstHeader, updateHeader, usePadding, usePadding, writeEndOfWire, writeFirstHeaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfromFile, headerNumber, newYamlWireOnHeapasText, commentListener, endEvent, hasMetaDataPrefix, hasMore, hintReadInputOrder, isEmpty, isEndEvent, isNotEmptyAfterPadding, objectInput, rawReadData, readAlignTo, readAllAsMap, readAndSetLength, readDataHeader, readDataHeader, readDocument, readDocument, readFirstHeader, readFirstHeader, readMetaDataHeader, startEventmethodReader, methodReaderBuilder, readBytes, readBytes, readDocument, readMap, readText, readTextdropDefault, endOfWire, enterHeader, objectOutput, padToCacheAlign, updateFirstHeader, updateFirstHeader, updateHeader, writeAlignTo, writeAllAsMap, writeDocument, writeEndOfWire, writeEvent, writeFirstHeader, writeNotCompleteDocument, writingDocumentbytes, bytesComment, classLookup, classLookup, headerNumber, notCompleteIsNotPresent, notCompleteIsNotPresent, parent, parent, pauser, pauser, usePadding, usePaddingbuilder, methodWriter, methodWriter, methodWriterBuilder, methodWriterBuilder, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeText@NotNull protected final @NotNull BinaryWire.BinaryValueIn valueIn
public BinaryWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
public BinaryWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean fixed,
boolean numericFields,
boolean fieldLess,
int compressedSize,
String compression,
boolean supportDelta)
@NotNull public static @NotNull BinaryWire binaryOnly(@NotNull @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
public void reset()
WireCommonreset in interface WireCommonpublic boolean isBinary()
WireCommonisBinary in interface WireCommonpublic Boolean getOverrideSelfDescribing()
public BinaryWire setOverrideSelfDescribing(Boolean overrideSelfDescribing)
overrideSelfDescribing - null is no override, true is always use self describing, false is never use self describing.@NotNull protected @NotNull StringBuilder acquireStringBuilder()
@NotNull protected @NotNull BinaryWire.FixedBinaryValueOut getFixedBinaryValueOut(boolean fixed)
@NotNull protected @NotNull BinaryWire.BinaryValueIn getBinaryValueIn()
public void clear()
WireCommonBytes stored by the wire.clear in interface WireCommonclear in interface WireInclear in interface WireOutclear in class AbstractWirepublic boolean fieldLess()
@NotNull public @NotNull DocumentContext writingDocument(boolean metaData)
WireOutwritingDocument in interface DocumentWrittenwritingDocument in interface MarshallableOutwritingDocument in interface WireOutmetaData - if true the document context will be used for writing meta data,
otherwise datapublic DocumentContext acquireWritingDocument(boolean metaData)
MarshallableOutacquireWritingDocument in interface DocumentWrittenacquireWritingDocument in interface MarshallableOutacquireWritingDocument in interface WireOut@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)
readingDocument in interface WireIn@NotNull public @NotNull String readingPeekYaml()
readingPeekYaml in interface WireInpublic void copyTo(@NotNull
@NotNull WireOut wire)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
public void copyOne(@NotNull
@NotNull WireOut wire)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
net.openhft.chronicle.core.io.InvalidMarshallableExceptionprotected static void unexpectedCode()
protected void anchor(@NotNull
@NotNull WireOut wire)
protected void fieldAnchor(@NotNull
@NotNull WireOut wire)
public void readWithLength(@NotNull
@NotNull WireOut wire,
int len)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
net.openhft.chronicle.core.io.InvalidMarshallableExceptionprotected void unknownCode(@NotNull
@NotNull WireOut wire)
@NotNull public @NotNull ValueIn read()
WireIn@NotNull public @NotNull ValueIn read(@NotNull @NotNull WireKey key)
WireInprotected <T> ValueIn read2(CharSequence keyName, int keyCode, T defaultSource, @NotNull @NotNull Function<T,Object> defaultLookup, @NotNull @NotNull net.openhft.chronicle.wire.ValueInState curr, @NotNull @NotNull StringBuilder sb, CharSequence name)
public long readEventNumber()
readEventNumber in interface WireInreadEventNumber in class AbstractWire@NotNull public @NotNull ValueIn readEventName(@NotNull @NotNull StringBuilder name)
WireInreadEventName in interface WireIn@NotNull public @NotNull ValueIn read(@NotNull @NotNull StringBuilder name)
WireIn@NotNull public @NotNull ValueIn getValueIn()
WireIngetValueIn in interface WireIn@NotNull public @NotNull Wire readComment(@NotNull @NotNull StringBuilder s)
readComment in interface WireIn@Nullable
public <K> K readEvent(@NotNull
@NotNull Class<K> expectedClass)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
WireInUse getValueIn() to read the value for this event
public void consumePadding()
consumePadding in interface WireInprotected int peekCode()
@NotNull protected @NotNull StringBuilder readFieldAnchor(@NotNull @NotNull StringBuilder sb)
@NotNull protected @NotNull StringBuilder readFieldNumber(CharSequence keyName, int keyCode, @NotNull @NotNull StringBuilder sb, long fieldId)
@NotNull public @NotNull ValueOut write()
WireOut@NotNull public @NotNull ValueOut writeEventName(@NotNull @NotNull WireKey key)
WireOutwriteEventName in interface WireOut@NotNull public @NotNull ValueOut writeEventName(@NotNull @NotNull CharSequence name)
writeEventName in interface WireOutpublic ValueOut writeEventId(int methodId)
writeEventId in interface WireOutpublic ValueOut writeEventId(String name, int methodId)
writeEventId in interface WireOutpublic 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 key)
@NotNull public @NotNull ValueOut getValueOut()
WireOutgetValueOut in interface WireOut@NotNull public @NotNull Wire writeComment(CharSequence s)
writeComment in interface WireOut@NotNull public @NotNull WireOut addPadding(int paddingToAdd)
addPadding in interface WireOutprotected net.openhft.chronicle.bytes.Bytes<?> writeCode(int code)
@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.BooleanValue newBooleanReference()
WireCommonBooleanValue. The BooleanValue implementation that is
returned depends on the wire implementation.newBooleanReference in interface WireCommonBooleanValue.@NotNull public @NotNull net.openhft.chronicle.core.values.TwoLongValue newTwoLongReference()
WireCommonTwoLongValue. The TwoLongValue implementation that
is returned depends on the wire implementation.newTwoLongReference in interface WireCommonTwoLongValue@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 WireCommonIntArrayValuespublic boolean useSelfDescribingMessage(@NotNull
@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
WireCommonuseSelfDescribingMessage in interface WireCommonpublic boolean writingIsComplete()
writingIsComplete in interface WireOutCopyright © 2023. All rights reserved.