java.lang.Object
swim.codec.Output<T>
swim.codec.OutputBuffer<T>
Non-blocking token stream buffer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract byte[]array()abstract intabstract intcapacity()clone()Returns an implementation-defined branch of the token stream.Writes the code points of the developer-readableDebugstring of the givenobject.Writes the code points of the human-readableDisplaystring of the givenobject.static <T> OutputBuffer<T>done()Returns anOutputBufferin the done state, that binds anullresult.static <T> OutputBuffer<T>done(OutputSettings settings) Returns anOutputBufferin the done state, with the givensettings.static <T> OutputBuffer<T>done(T value) Returns anOutputBufferin the done state, that binds the givenvalue.static <T> OutputBuffer<T>done(T value, OutputSettings settings) Returns anOutputBufferin the done state, that binds the givenvalue, with the givensettings.static <T> OutputBuffer<T>Returns anOutputBufferin the error state, with the given outputerror.static <T> OutputBuffer<T>error(Throwable error, OutputSettings settings) Returns anOutputBufferin the error state, with the given outputerrorandsettings.flush()Writes any internally buffered state to the underlying output stream.Returns anOutputequivalent to thisOutput, but whose behavior may be altered by the given out-of-bandcondition.static <T> OutputBuffer<T>full()Returns anOutputBufferin the full state, that binds anullresult.static <T> OutputBuffer<T>full(OutputSettings settings) Returns anOutputBufferin the full state, with the givensettings.static <T> OutputBuffer<T>full(T value) Returns anOutputBufferin the full state, that binds the givenvalue.static <T> OutputBuffer<T>full(T value, OutputSettings settings) Returns anOutputBufferin the full state, that binds the givenvalue, with the givensettings.abstract intget(int index) abstract booleanhas(int index) abstract intindex()abstract OutputBuffer<T>index(int index) abstract OutputBuffer<T>isPart(boolean isPart) Returns a partialOutputequivalent to thisOutput, ifisPartistrue; returns a finalOutputequivalent to thisOutputifisPartisfalse.abstract intlimit()abstract OutputBuffer<T>limit(int limit) abstract OutputBuffer<T>move(int fromIndex, int toIndex, int length) abstract intabstract voidset(int index, int token) abstract OutputBuffer<T>settings(OutputSettings settings) Updates thesettingsassociated with thisOutput.abstract OutputBuffer<T>step(int offset) abstract OutputBuffer<T>write(int token) Writes a singletokento the stream, if thisOutputis in the cont state.Writes the code points of the givenstring.abstract intwrite(ReadableByteChannel channel) writeln()Writes the code points of thesettings'line separator.Writes the code points of the givenstring, followed by the code points of thesettings'line separator.
-
Constructor Details
-
OutputBuffer
public OutputBuffer()
-
-
Method Details
-
isPart
Description copied from class:OutputReturns a partialOutputequivalent to thisOutput, ifisPartistrue; returns a finalOutputequivalent to thisOutputifisPartisfalse. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
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) -
write
- Throws:
IOException
-
write
Description copied from class:OutputWrites a singletokento the stream, if thisOutputis in the cont state. Returns anOutputin the error state if thisOutputis not in the cont state. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
write
Description copied from class:OutputWrites the code points of the givenstring. Assumes this is a UnicodeOutputwith sufficient capacity. Returns anOutputin the error state if thisOutputexits the cont state before the fullstringhas been writtem. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
writeln
Description copied from class:OutputWrites the code points of the givenstring, followed by the code points of thesettings'line separator. Assumes this is a UnicodeOutputwith sufficient capacity. Returns anOutputin the error state if thisOutputexits the cont state before the fullstringand line separator has been written. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
writeln
Description copied from class:OutputWrites the code points of thesettings'line separator. Assumes this is a UnicodeOutputwith sufficient capacity. Returns anOutputin the error state if thisOutputexits the cont state before the full line separator has been written. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
display
Description copied from class:OutputWrites the code points of the human-readableDisplaystring of the givenobject. Assumes this is a UnicodeOutputwith sufficient capacity. Returns anOutputin the error state if thisOutputexits the contt state before the full display string has been written. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
debug
Description copied from class:OutputWrites the code points of the developer-readableDebugstring of the givenobject. Assumes this is a UnicodeOutputwith sufficient capacity. Returns anOutputin the error state if thisOutputexits the contt state before the full debug string has been written. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
move
-
step
-
flush
Description copied from class:OutputWrites any internally buffered state to the underlying output stream. -
fork
Description copied from class:OutputReturns anOutputequivalent to thisOutput, but whose behavior may be altered by the given out-of-bandcondition. The caller's reference tothisOutputshould be replaced by the returnedOutput. -
settings
Description copied from class:OutputUpdates thesettingsassociated with thisOutput. -
clone
Description copied from class:OutputReturns an implementation-defined branch of the token stream. -
full
Returns anOutputBufferin the full state, that binds anullresult. -
full
Returns anOutputBufferin the full state, with the givensettings. -
full
Returns anOutputBufferin the full state, that binds the givenvalue. -
full
Returns anOutputBufferin the full state, that binds the givenvalue, with the givensettings. -
done
Returns anOutputBufferin the done state, that binds anullresult. -
done
Returns anOutputBufferin the done state, with the givensettings. -
done
Returns anOutputBufferin the done state, that binds the givenvalue. -
done
Returns anOutputBufferin the done state, that binds the givenvalue, with the givensettings. -
error
Returns anOutputBufferin the error state, with the given outputerror. -
error
Returns anOutputBufferin the error state, with the given outputerrorandsettings.
-