Package com.cedarsoftware.util
Class FastReader.BufferSlice
java.lang.Object
com.cedarsoftware.util.FastReader.BufferSlice
- Enclosing class:
FastReader
Borrowed view of a contiguous range inside
FastReader's internal buffers.
The contents are valid only until release() or the next read operation on
the same reader, whichever comes first.
Callers must consume or copy the slice contents, then call release()
before invoking any other FastReader method that reads, pushes back, or
closes the reader. With assertions enabled, FastReader verifies this
lifecycle and fails fast if a borrowed slice is left outstanding.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BufferSlice
public BufferSlice()
-
-
Method Details
-
getBuffer
public char[] getBuffer() -
getOffset
public int getOffset() -
getLength
public int getLength() -
release
public void release()Mark this borrowed slice as consumed. Call after copying or otherwise materializing the borrowed contents, and before the next FastReader operation.
-