public interface WireOut extends WireCommon
| Modifier and Type | Method and Description |
|---|---|
WireOut |
addPadding(int paddingToAdd) |
void |
clear()
This will reset the positions and the header number.
|
default WireOut |
dropDefault(boolean dropDefault) |
void |
endEvent() |
ValueOut |
getValueOut()
Obtain the value out
|
ObjectOutput |
objectOutput() |
default WireOut |
padToCacheAlign()
If near the end of a cache line, pad it so a following 4-byte int value will not split a
cache line.
|
void |
startEvent()
Start an event object, mostly for internal use.
|
void |
updateFirstHeader()
update the first header after writing.
|
void |
updateHeader(int length,
long position,
boolean metaData)
Change the header from NOT_COMPLETE | length to metaData * META_DATA | length.
|
default void |
updateHeader(long position,
boolean metaData)
Change the header from NOT_COMPLETE | UNKNOWN_LENGTH to metaData * META_DATA | length.
|
ValueOut |
write()
Write an empty filed marker
|
ValueOut |
write(CharSequence key) |
ValueOut |
write(WireKey key)
Write a key for wires that support fields.
|
default WireOut |
writeAlignTo(int alignment,
int plus) |
default <K,V> void |
writeAllAsMap(Class<K> kClass,
Class<V> vClass,
Map<K,V> map) |
WireOut |
writeComment(CharSequence s) |
default void |
writeDocument(boolean metaData,
WriteMarshallable writer)
This will increment the headerNumber as appropriate if successful
|
void |
writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
Write the end of wire marker, unless one is already written.
|
default ValueOut |
writeEvent(Class expectedType,
Object eventKey) |
default ValueOut |
writeEventName(CharSequence key) |
default ValueOut |
writeEventName(WireKey key)
Always write a key.
|
boolean |
writeFirstHeader()
Start the first header, if there is none This will increment the headerNumber as appropriate
if successful
|
long |
writeHeader(int length,
int safeLength,
long timeout,
TimeUnit timeUnit,
net.openhft.chronicle.core.values.LongValue lastPosition) |
default long |
writeHeader(int length,
long timeout,
TimeUnit timeUnit,
net.openhft.chronicle.core.values.LongValue lastPosition)
Write a message of a known length, handling timeouts and the end of wire marker.
|
default long |
writeHeader(long timeout,
TimeUnit timeUnit,
net.openhft.chronicle.core.values.LongValue lastPosition)
Write a new header, an unknown length, handling timeouts and the end of wire marker.
|
default void |
writeNotCompleteDocument(boolean metaData,
WriteMarshallable writer)
This will increment the headerNumber as appropriate if successful
|
default DocumentContext |
writingDocument() |
DocumentContext |
writingDocument(boolean metaData)
This will increment the headerNumber as appropriate if successful
|
bytes, classLookup, classLookup, endUse, headerNumber, headerNumber, newIntReference, newLongArrayReference, newLongReference, notCompleteIsNotPresent, notCompleteIsNotPresent, parent, parent, pauser, pauser, startUse@NotNull ValueOut write()
@NotNull default ValueOut writeEventName(WireKey key)
default ValueOut writeEventName(CharSequence key)
ValueOut write(CharSequence key)
@NotNull ValueOut getValueOut()
ObjectOutput objectOutput()
@NotNull WireOut writeComment(CharSequence s)
@NotNull WireOut addPadding(int paddingToAdd)
@NotNull default WireOut padToCacheAlign()
@NotNull default WireOut writeAlignTo(int alignment, int plus)
void clear()
clear in interface WireCommondefault void writeDocument(boolean metaData,
@NotNull
WriteMarshallable writer)
metaData - writer - DocumentContext writingDocument(boolean metaData)
metaData - if true the document context will be used for writing meta data,
otherwise datadefault DocumentContext writingDocument()
default void writeNotCompleteDocument(boolean metaData,
@NotNull
WriteMarshallable writer)
metaData - true if the write should write metaData rather than datawriter - writes bytes to the wiredefault long writeHeader(long timeout,
TimeUnit timeUnit,
@Nullable
net.openhft.chronicle.core.values.LongValue lastPosition)
throws TimeoutException,
EOFException
timeout - throw a TimeoutException if the header could not be written in this
time.timeUnit - of the timeOutlastPosition - the last known positionTimeoutException - the underlying pauser timed out.EOFException - the end of wire marker was reached.default void updateHeader(long position,
boolean metaData)
throws StreamCorruptedException
position - returned by writeHeadermetaData - whether the message is meta data or not.StreamCorruptedException - if the steam has become corrupteddefault long writeHeader(int length,
long timeout,
TimeUnit timeUnit,
@Nullable
net.openhft.chronicle.core.values.LongValue lastPosition)
throws TimeoutException,
EOFException
length - the maximum length of the message.timeout - throw a TimeoutException if the header could not be written in this
time.timeUnit - of the timeOutlastPosition - the last known positionTimeoutException - the underlying pauser timed out.EOFException - the end of wire marker was reached.long writeHeader(int length,
int safeLength,
long timeout,
TimeUnit timeUnit,
@Nullable
net.openhft.chronicle.core.values.LongValue lastPosition)
throws TimeoutException,
EOFException
TimeoutExceptionEOFExceptionvoid updateHeader(int length,
long position,
boolean metaData)
throws StreamCorruptedException
length - provided to make the header, note this can be larger than the message
actually used.position - returned by writeHeadermetaData - whether the message is meta data or not.StreamCorruptedException - if the steam has become corruptedboolean writeFirstHeader()
Note: the file might contain other data and the caller has to check this.
void updateFirstHeader()
void writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
throws TimeoutException
timeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutlastPosition - the end of the wireTimeoutException - timeout exceeded.void startEvent()
void endEvent()
default <K,V> void writeAllAsMap(Class<K> kClass, Class<V> vClass, @NotNull Map<K,V> map)
default WireOut dropDefault(boolean dropDefault)
Copyright © 2017. All rights reserved.