java.lang.Object
swim.codec.Input
swim.codec.InputBuffer
Non-blocking token stream buffer.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract byte[]
array()
abstract int
abstract int
capacity()
abstract InputBuffer
clone()
Returns an independently positioned view into the token stream, initialized with identical state to thisInput
.static InputBuffer
done()
Returns anInputBuffer
in the done state.static InputBuffer
Returns anInputBuffer
in the done state, at themark
position of a token stream logically identified byid
.static InputBuffer
done
(Object id, Mark mark, InputSettings settings) Returns anInputBuffer
in the done state, at themark
position of a token stream logically identified byid
, with the givensettings
.static InputBuffer
done
(InputSettings settings) Returns anInputBuffer
in the done state, with the givensettings
.static InputBuffer
empty()
Returns anInputBuffer
in the empty state.static InputBuffer
Returns anInputBuffer
in the empty state, at themark
position of a token stream logically identified byid
.static InputBuffer
empty
(Object id, Mark mark, InputSettings settings) Returns anInputBuffer
in the empty state, at themark
position of a token stream logically identified byid
, with the givensettings
.static InputBuffer
empty
(InputSettings settings) Returns anInputBuffer
in the empty state, with the givensettings
.static InputBuffer
Returns anInputBuffer
in the error state, with the given inputerror
.static InputBuffer
Returns anInputBuffer
in the error state, with the given inputerror
, at themark
position of a token stream logically identified byid
.static InputBuffer
error
(Throwable error, Object id, Mark mark, InputSettings settings) Returns anInputBuffer
in the error state, with the given inputerror
, at themark
position of a token stream logically identified byid
, with the givensettings
.static InputBuffer
error
(Throwable error, InputSettings settings) Returns anInputBuffer
in the error state, with the given inputerror
andsettings
.Returns anInput
equivalent to thisInput
, but whose behavior may be altered by the given out-of-bandcondition
.abstract int
get
(int index) abstract boolean
has
(int index) abstract InputBuffer
Returns anInput
equivalent to thisInput
, but logically identified by the given–possiblynull
–id
.abstract int
index()
abstract InputBuffer
index
(int index) abstract InputBuffer
isPart
(boolean isPart) Returns a partialInput
equivalent to thisInput
, ifisPart
istrue
; returns a finalInput
equivalent to thisInput
ifisPart
isfalse
.abstract int
limit()
abstract InputBuffer
limit
(int limit) abstract InputBuffer
Returns anInput
equivalent to thisInput
, but logically positioned at the givenmark
.abstract int
abstract InputBuffer
Returns anInput
equivalent to thisInput
, but repositioned to the givenmark
.abstract void
set
(int index, int token) abstract InputBuffer
settings
(InputSettings settings) Returns anInput
equivalent to thisInput
, but with the given inputsettings
.abstract InputBuffer
step()
Returns anInput
equivalent to thisInput
, but advanced to the next token.abstract InputBuffer
step
(int offset)
-
Constructor Details
-
InputBuffer
public InputBuffer()
-
-
Method Details
-
isPart
Description copied from class:Input
Returns a partialInput
equivalent to thisInput
, ifisPart
istrue
; returns a finalInput
equivalent to thisInput
ifisPart
isfalse
. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
index
public abstract int index() -
index
-
limit
public abstract int limit() -
limit
-
capacity
public abstract int capacity() -
remaining
public abstract int remaining() -
array
public abstract byte[] array() -
arrayOffset
public abstract int arrayOffset() -
has
public abstract boolean has(int index) -
get
public abstract int get(int index) -
set
public abstract void set(int index, int token) -
step
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but advanced to the next token. Returns anInput
in the error state if thisInput
is not in the cont state. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
step
-
seek
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but repositioned to the givenmark
. Returns anInput
in the error state if thisInput
does not support seeking, or if thisInput
is unable to reposition to the givenmark
. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
fork
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but whose behavior may be altered by the given out-of-bandcondition
. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
id
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but logically identified by the given–possiblynull
–id
. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
mark
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but logically positioned at the givenmark
. The physical position in the input stream is not modified. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
settings
Description copied from class:Input
Returns anInput
equivalent to thisInput
, but with the given inputsettings
. The caller's reference tothis
Input
should be replaced by the returnedInput
. -
clone
Description copied from class:Input
Returns an independently positioned view into the token stream, initialized with identical state to thisInput
. -
empty
Returns anInputBuffer
in the empty state. -
empty
Returns anInputBuffer
in the empty state, with the givensettings
. -
empty
Returns anInputBuffer
in the empty state, at themark
position of a token stream logically identified byid
. -
empty
Returns anInputBuffer
in the empty state, at themark
position of a token stream logically identified byid
, with the givensettings
. -
done
Returns anInputBuffer
in the done state. -
done
Returns anInputBuffer
in the done state, with the givensettings
. -
done
Returns anInputBuffer
in the done state, at themark
position of a token stream logically identified byid
. -
done
Returns anInputBuffer
in the done state, at themark
position of a token stream logically identified byid
, with the givensettings
. -
error
Returns anInputBuffer
in the error state, with the given inputerror
. -
error
Returns anInputBuffer
in the error state, with the given inputerror
andsettings
. -
error
Returns anInputBuffer
in the error state, with the given inputerror
, at themark
position of a token stream logically identified byid
. -
error
Returns anInputBuffer
in the error state, with the given inputerror
, at themark
position of a token stream logically identified byid
, with the givensettings
.
-