public abstract class AbstractWire extends Object implements Wire
WireIn.HeaderTypeWireOut.EndOfWire| Modifier and Type | Field and Description |
|---|---|
protected @NotNull net.openhft.chronicle.bytes.Bytes<?> |
bytes |
protected net.openhft.chronicle.core.pool.ClassLookup |
classLookup |
protected Consumer<CharSequence> |
commentListener |
static boolean |
DEFAULT_USE_PADDING |
protected Object |
parent |
protected boolean |
use8bit |
MARSHALLABLE_IN_INTERN_SIZE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean use8bit) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull net.openhft.chronicle.bytes.Bytes<?> |
bytes()
Returns the underlying
Bytes stored by the wire. |
net.openhft.chronicle.bytes.HexDumpBytesDescription<?> |
bytesComment()
Returns the bytes() but only for comment.
|
net.openhft.chronicle.core.pool.ClassLookup |
classLookup()
Returns the current
ClassLookup implementation being used for class lookup. |
void |
classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
Sets the
ClassLookup implementation to be used for class lookup. |
void |
clear()
Resets the state of the underlying
Bytes stored by the wire. |
void |
commentListener(Consumer<CharSequence> commentListener) |
WireOut.EndOfWire |
endOfWire(boolean writeEOF,
long timeout,
TimeUnit timeUnit,
long lastPosition)
Check if end of wire marker is present, optionally writing it unless one is already written.
|
long |
enterHeader(long safeLength)
INTERNAL METHOD, call writingDocument instead
|
void |
forceNotInsideHeader()
used by write bytes when doing a rollback
|
long |
headerNumber() |
@NotNull Wire |
headerNumber(long headerNumber) |
void |
headNumberCheck(HeadNumberChecker headNumberChecker) |
boolean |
isInsideHeader() |
boolean |
notCompleteIsNotPresent()
If a message is marked as NOT_COMPLETE is it still present.
|
void |
notCompleteIsNotPresent(boolean notCompleteIsNotPresent) |
ObjectInput |
objectInput() |
ObjectOutput |
objectOutput() |
Object |
parent()
Returns the wire parent object.
|
void |
parent(Object parent)
Assigns the wire parent object for later retrieval.
|
net.openhft.chronicle.threads.Pauser |
pauser()
Returns the current
Pauser implementation being used for blocking operations. |
void |
pauser(net.openhft.chronicle.threads.Pauser pauser)
Sets the
Pauser implementation to be used for blocking operations. |
void |
readAndSetLength(long position) |
@NotNull WireIn.HeaderType |
readDataHeader(boolean includeMetaData) |
long |
readEventNumber() |
void |
readFirstHeader() |
void |
readFirstHeader(long timeout,
TimeUnit timeUnit) |
void |
readMetaDataHeader() |
void |
updateFirstHeader()
INTERNAL METHOD, call writingDocument instead
|
void |
updateFirstHeader(long headerEndPos)
INTERNAL METHOD, call writingDocument instead
|
void |
updateHeader(long position,
boolean metaData,
int expectedHeader)
INTERNAL METHOD, call writingDocument instead
|
boolean |
usePadding() |
void |
usePadding(boolean usePadding) |
boolean |
writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
Write the end of wire marker, unless one is already written.
|
boolean |
writeFirstHeader()
INTERNAL METHOD, call writingDocument instead
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromFile, newYamlWireOnHeapasText, consumePadding, copyTo, endEvent, getValueIn, hasMetaDataPrefix, hasMore, hintReadInputOrder, isEmpty, isEndEvent, isNotEmptyAfterPadding, rawReadData, read, read, read, read, readAlignTo, readAllAsMap, readComment, readDataHeader, readDocument, readDocument, readEvent, readEventName, readingDocument, readingDocument, readingPeekYaml, startEventmethodReader, methodReaderBuilder, readBytes, readBytes, readDocument, readMap, readText, readTextacquireWritingDocument, addPadding, dropDefault, getValueOut, padToCacheAlign, write, write, write, writeAlignTo, writeAllAsMap, writeComment, writeDocument, writeEndEvent, writeEvent, writeEventId, writeEventId, writeEventName, writeEventName, writeNotCompleteDocument, writeStartEvent, writingDocument, writingDocument, writingIsCompleteisBinary, newBooleanReference, newIntArrayReference, newIntReference, newLongArrayReference, newLongReference, newTwoLongReference, reset, useSelfDescribingMessagebuilder, methodWriter, methodWriter, methodWriterBuilder, methodWriterBuilder, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeTextpublic static final boolean DEFAULT_USE_PADDING
@NotNull protected final @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes
protected final boolean use8bit
protected net.openhft.chronicle.core.pool.ClassLookup classLookup
protected Object parent
protected Consumer<CharSequence> commentListener
protected AbstractWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean use8bit)
public boolean isInsideHeader()
public net.openhft.chronicle.threads.Pauser pauser()
WireCommonPauser implementation being used for blocking operations.pauser in interface WireCommonPauser implementation being used for blocking operationspublic void pauser(net.openhft.chronicle.threads.Pauser pauser)
WireCommonPauser implementation to be used for blocking operations.pauser in interface WireCommonpauser - implementation to be used for blocking operations.public void clear()
WireCommonBytes stored by the wire.@NotNull public @NotNull Wire headerNumber(long headerNumber)
headerNumber in interface WireheaderNumber in interface WireCommonpublic void headNumberCheck(HeadNumberChecker headNumberChecker)
public long headerNumber()
headerNumber in interface WireCommonpublic void classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
WireCommonClassLookup implementation to be used for class lookup.classLookup in interface WireCommonclassLookup - implementation to be used for class lookup.public net.openhft.chronicle.core.pool.ClassLookup classLookup()
WireCommonClassLookup implementation being used for class lookup.classLookup in interface WireCommonClassLookup implementation being used for class lookup@NotNull public @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes()
WireCommonBytes stored by the wire.bytes in interface WireCommonBytes stored by the wirepublic net.openhft.chronicle.bytes.HexDumpBytesDescription<?> bytesComment()
WireCommonbytesComment in interface WireCommonpublic void commentListener(Consumer<CharSequence> commentListener)
commentListener in interface WireIn@NotNull public @NotNull WireIn.HeaderType readDataHeader(boolean includeMetaData)
readDataHeader in interface WireInpublic void readAndSetLength(long position)
readAndSetLength in interface WireInpublic void readMetaDataHeader()
readMetaDataHeader in interface WireInpublic void readFirstHeader()
throws StreamCorruptedException
readFirstHeader in interface WireInStreamCorruptedExceptionpublic void readFirstHeader(long timeout,
TimeUnit timeUnit)
throws TimeoutException,
StreamCorruptedException
readFirstHeader in interface WireInTimeoutExceptionStreamCorruptedExceptionpublic long enterHeader(long safeLength)
WireOutStart a header for a document
enterHeader in interface WireOutsafeLength - ensure there is at least this much spacepublic void updateHeader(long position,
boolean metaData,
int expectedHeader)
throws StreamCorruptedException
WireOutUpdate/end a header for a document
updateHeader in interface WireOutStreamCorruptedExceptionpublic boolean writeFirstHeader()
WireOutStart the first header, if there is none This will increment the headerNumber as appropriate if successful
Note: the file might contain other data and the caller has to check this.
writeFirstHeader in interface WireOutpublic void updateFirstHeader()
WireOutupdate the first header after writing.
updateFirstHeader in interface WireOutpublic void updateFirstHeader(long headerEndPos)
WireOut
update the first header after writing headerEndPos bytes.
updateFirstHeader in interface WireOutpublic boolean writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
WireOutwriteEndOfWire in interface WireOuttimeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutlastPosition - the end of the wirefalse if it was already there.public WireOut.EndOfWire endOfWire(boolean writeEOF, long timeout, TimeUnit timeUnit, long lastPosition)
WireOutendOfWire in interface WireOutwriteEOF - if true, write end of wire marker unless already existstimeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutlastPosition - the end of the wireWireOut.EndOfWire enum corresponding to EOF presencepublic Object parent()
WireCommonnull is
returned instead.parent in interface WireCommonnull if none was assigned.public void parent(Object parent)
WireCommonparent in interface WireCommonparent - to set, or null if there isn't one.public boolean notCompleteIsNotPresent()
WireCommonnotCompleteIsNotPresent in interface WireCommonpublic void notCompleteIsNotPresent(boolean notCompleteIsNotPresent)
notCompleteIsNotPresent in interface WireCommonpublic ObjectOutput objectOutput()
objectOutput in interface WireOutpublic ObjectInput objectInput()
objectInput in interface WireInpublic long readEventNumber()
readEventNumber in interface WireInpublic void forceNotInsideHeader()
public void usePadding(boolean usePadding)
usePadding in interface WireCommonpublic boolean usePadding()
usePadding in interface WireCommonCopyright © 2023. All rights reserved.