Module io.jstach.jstachio
Package io.jstach.jstachio
Interface Output.EncodedOutput<E extends Exception>
- Type Parameters:
E
- the exception type
- All Superinterfaces:
Output<E>
- All Known Subinterfaces:
BufferedEncodedOutput
,ByteBufferEncodedOutput
,ChunkEncodedOutput<T>
,LimitEncodedOutput<T,
,E> Output.CloseableEncodedOutput<E>
- All Known Implementing Classes:
ByteBufferedOutputStream
,ForwardingEncodedOutput
,ThresholdEncodedOutput
,ThresholdEncodedOutput.OutputStreamThresholdEncodedOutput
A specialized Output designed for pre-encoded templates that have already encoded
byte arrays to be used directly.
- Author:
- agentgt
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jstach.jstachio.Output
Output.CloseableEncodedOutput<E extends Exception>, Output.EncodedOutput<E extends Exception>, Output.StringOutput
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
append
(char c) Appends a character to an appendable.default void
append
(CharSequence csq, int start, int end) Analogous toAppendable.append(CharSequence, int, int)
.default void
Analogous toAppendable.append(CharSequence)
which by default treats the String as a CharSequence.charset()
The charset that the encoded output should be.of
(OutputStream a, Charset charset) Adapts anOutputStream
as anOutput.EncodedOutput
.void
write
(byte[] bytes) Analogous toOutputStream.write(byte[])
.default void
write
(byte[] bytes, int off, int len) Analogous toOutputStream.write(byte[], int, int)
.
-
Method Details
-
write
Analogous toOutputStream.write(byte[])
. Implementations should not alter the byte array.- Parameters:
bytes
- already encoded bytes- Throws:
E
- if an error happens
-
write
Analogous toOutputStream.write(byte[], int, int)
. Generated templates do not call this method as great care as to be taken to preserve the encoding. It is only provided in the case of future found optimizations and is not currently required.The default implementation creates an array copies the data and then calls
write(byte[])
.- Parameters:
bytes
- already encoded bytesoff
- offsetlen
- length to copy- Throws:
E
- if an error happens
-
append
Description copied from interface:Output
Appends a character to an appendable. -
append
Description copied from interface:Output
Analogous toAppendable.append(CharSequence)
which by default treats the String as a CharSequence. -
append
Description copied from interface:Output
Analogous toAppendable.append(CharSequence, int, int)
. -
charset
The charset that the encoded output should be.- Returns:
- expected charset
-
of
Adapts anOutputStream
as anOutput.EncodedOutput
. The resulting output can be closed and will close the passed in OutputStream.- Parameters:
a
- the OutputStream to be wrapped.charset
- the encoding to use- Returns:
- outputstream output
-