Module io.jstach.jstachio
Package io.jstach.jstachio.output
Class ForwardingEncodedOutput<E extends Exception>
java.lang.Object
io.jstach.jstachio.output.ForwardingOutput<E>
io.jstach.jstachio.output.ForwardingEncodedOutput<E>
- Type Parameters:
E
- error throw on any append or write
- All Implemented Interfaces:
Output<E>
,Output.EncodedOutput<E>
public abstract class ForwardingEncodedOutput<E extends Exception>
extends ForwardingOutput<E>
implements Output.EncodedOutput<E>
An encoded output that forwards all calls to a delegate.
-
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncharset()
The charset that the encoded output should be.protected abstract Output.EncodedOutput<E>
delegate()
The output to forward to.void
write
(byte[] bytes) Analogous toOutputStream.write(byte[])
.void
write
(byte[] bytes, int off, int len) Analogous toOutputStream.write(byte[], int, int)
.Methods inherited from class io.jstach.jstachio.output.ForwardingOutput
append, append, append, append, append, append, append, append, append, toAppendable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jstach.jstachio.Output
append, append, append, append, append, append, toAppendable
Methods inherited from interface io.jstach.jstachio.Output.EncodedOutput
append, append, append
-
Constructor Details
-
ForwardingEncodedOutput
protected ForwardingEncodedOutput()Do nothing constructor
-
-
Method Details
-
write
Description copied from interface:Output.EncodedOutput
Analogous toOutputStream.write(byte[])
. Implementations should not alter the byte array.- Specified by:
write
in interfaceOutput.EncodedOutput<E extends Exception>
- Parameters:
bytes
- already encoded bytes- Throws:
E
- if an error happens
-
write
Description copied from interface:Output.EncodedOutput
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
Output.EncodedOutput.write(byte[])
.- Specified by:
write
in interfaceOutput.EncodedOutput<E extends Exception>
- Parameters:
bytes
- already encoded bytesoff
- offsetlen
- length to copy- Throws:
E
- if an error happens
-
charset
Description copied from interface:Output.EncodedOutput
The charset that the encoded output should be.- Specified by:
charset
in interfaceOutput.EncodedOutput<E extends Exception>
- Returns:
- expected charset
-
delegate
Description copied from class:ForwardingOutput
The output to forward to.- Specified by:
delegate
in classForwardingOutput<E extends Exception>
- Returns:
- output to forward to.
-