- Type Parameters:
E- the exception type that can happen on output
- All Known Subinterfaces:
BufferedEncodedOutput,ByteBufferEncodedOutput,ChunkEncodedOutput<T>,LimitEncodedOutput<T,,E> Output.CloseableEncodedOutput<E>,Output.EncodedOutput<E>
- All Known Implementing Classes:
ByteBufferedOutputStream,ForwardingEncodedOutput,ForwardingOutput,Output.StringOutput,ThresholdEncodedOutput,ThresholdEncodedOutput.OutputStreamThresholdEncodedOutput
A low level abstraction and implementation detail analogous to
Appendable and
DataOutput.- Author:
- agentgt
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOutput.CloseableEncodedOutput<E extends Exception>An encoded output that can be closed.static interfaceOutput.EncodedOutput<E extends Exception>A specialized Output designed for pre-encoded templates that have already encoded byte arrays to be used directly.static classString Builder based output. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidappend(boolean b) Write a long by usingString.valueOf(long).voidappend(char c) Appends a character to an appendable.default voidappend(double d) Write a long by usingString.valueOf(long).default voidappend(int i) Write a int by usingString.valueOf(int).default voidappend(long l) Write a long by usingString.valueOf(long).default voidappend(short s) Write a short by usingString.valueOf(int)voidAnalogous toAppendable.append(CharSequence).voidappend(CharSequence csq, int start, int end) Analogous toAppendable.append(CharSequence, int, int).default voidAnalogous toAppendable.append(CharSequence)which by default treats the String as a CharSequence.static Output.EncodedOutput<IOException>of(OutputStream a, Charset charset) Adapts anOutputStreamas anOutput.static Output<IOException>of(Appendable a) Adapts anAppendableas anOutput.static Output.StringOutputof(StringBuilder a) Adapts aStringBuilderas anOutput.default AppendableConverts the output to an appendable unless it already is one.
-
Method Details
-
append
Analogous toAppendable.append(CharSequence).- Parameters:
s- unlike appendable always non null.- Throws:
E- if an error happens while writting to the appendable- API Note
- Implementations are required to implement this method.
-
append
Analogous toAppendable.append(CharSequence)which by default treats the String as a CharSequence.- Parameters:
s- unlike appendable always non null.- Throws:
E- if an error happens while writting to the appendable- API Note
- Implementations are required to implement this method.
-
append
Analogous toAppendable.append(CharSequence, int, int).- Parameters:
csq- Unlike appendable never null.start- start inclusiveend- end exclusive- Throws:
E- if an error happens while writting to the appendable- API Note
- Implementations are required to implement this method.
-
append
Appends a character to an appendable.- Parameters:
c- character- Throws:
E- if an error happens while writting to the appendable- API Note
- Implementations are required to implement this method.
-
append
Write a short by usingString.valueOf(int)- Parameters:
s- short- Throws:
E- if an error happens while writting to the appendable
-
append
Write a int by usingString.valueOf(int).Implementations should override if they want different behavior or able to support appendables that can write the native type.
- Parameters:
i- int- Throws:
E- if an error happens while writting to the appendable
-
append
Write a long by usingString.valueOf(long).Implementations should override if they want different behavior or able to support appendables that can write the native type.
- Parameters:
l- long- Throws:
E- if an error happens while writting to the appendable
-
append
Write a long by usingString.valueOf(long).Implementations should override if they want different behavior or able to support appendables that can write the native type.
- Parameters:
d- double- Throws:
E- if an error happens while writting to the appendable
-
append
Write a long by usingString.valueOf(long).Implementations should override if they want different behavior or able to support appendables that can write the native type.
- Parameters:
b- boolean- Throws:
E- if an error happens while writting to the appendable
-
of
Adapts anOutputStreamas anOutput.- Parameters:
a- the OutputStream to be wrapped.charset- the encoding to use- Returns:
- outputstream output
-
of
Adapts anAppendableas anOutput.- Parameters:
a- the appendable to be wrapped.- Returns:
- string based output
-
of
Adapts aStringBuilderas anOutput.- Parameters:
a- the StringBuilder to be wrapped.- Returns:
- string based output
-
toAppendable
Converts the output to an appendable unless it already is one.- Returns:
- adapted appendable of this output.
-