public class BinaryReadDocumentContext extends Object implements ReadDocumentContext
| Modifier and Type | Field and Description |
|---|---|
long |
lastStart |
protected boolean |
metaData |
protected boolean |
notComplete |
protected boolean |
present |
protected long |
readLimit |
protected long |
readPosition |
protected boolean |
rollback |
long |
start |
protected @Nullable AbstractWire |
wire |
NOOP| Constructor and Description |
|---|
BinaryReadDocumentContext(@Nullable Wire wire) |
BinaryReadDocumentContext(@Nullable Wire wire,
boolean ensureFullRead) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeReadLimit(long readLimit)
Sets the read limit for this
ReadDocumentContext. |
void |
closeReadPosition(long readPosition)
Sets the read position for this
ReadDocumentContext. |
long |
index()
Index last read, only available for read contexts.
|
boolean |
isMetaData()
Checks it the
DocumentContext is metadata. |
boolean |
isNotComplete() |
boolean |
isPresent()
Checks if the
DocumentContext is present. |
void |
reset()
call close once, then discard any remaining state
|
protected boolean |
rollback() |
protected boolean |
rollbackIfNeeded()
Rolls back document context state to a one before opening if rollback marker is set.
|
void |
rollbackOnClose()
Call this if you have detected an error condition and you want the context
rolled back when it is closed, rather than half a message committed
|
void |
setStart(long start) |
int |
sourceId()
Returns the source id of this source context.
|
void |
start() |
String |
toString() |
@Nullable Wire |
wire()
Returns the
Wire associated with the Document. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisData, isOpenpublic long start
public long lastStart
@Nullable protected @Nullable AbstractWire wire
protected boolean present
protected boolean notComplete
protected long readPosition
protected long readLimit
protected boolean metaData
protected boolean rollback
public BinaryReadDocumentContext(@Nullable
@Nullable Wire wire)
public BinaryReadDocumentContext(@Nullable
@Nullable Wire wire,
boolean ensureFullRead)
public boolean isMetaData()
DocumentContextDocumentContext is metadata. If it is, true is
returned, otherwise false.isMetaData in interface DocumentContextpublic boolean isPresent()
DocumentContextDocumentContext is present. If it is, true is returned,
otherwise false.isPresent in interface DocumentContextpublic void closeReadPosition(long readPosition)
ReadDocumentContextReadDocumentContext.closeReadPosition in interface ReadDocumentContextpublic void closeReadLimit(long readLimit)
ReadDocumentContextReadDocumentContext.closeReadLimit in interface ReadDocumentContext@Nullable public @Nullable Wire wire()
DocumentContextWire associated with the Document. It is possible that
null is returned, depending on the implementation.wire in interface DocumentContextWire associated with the Document.protected boolean rollback()
public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface DocumentContextpublic void reset()
DocumentContextreset in interface DocumentContextprotected boolean rollbackIfNeeded()
public void start()
start in interface ReadDocumentContextpublic long index()
SourceContextindex in interface SourceContextpublic int sourceId()
SourceContextsourceId in interface SourceContextpublic boolean isNotComplete()
isNotComplete in interface DocumentContextpublic void rollbackOnClose()
DocumentContextrollbackOnClose in interface DocumentContextpublic void setStart(long start)
Copyright © 2023. All rights reserved.