kactoos-jvm / nnl.rocks.kactoos / Output
@FunctionalInterface interface Output
Output.
Here is for example how Output can be used together with Input in order to modify the content of a text file:
new LengthOf(
new TeeInput(
new InputOf(new TextOf("Hello, world!")),
new OutputTo(new File("/tmp/names.txt"))
)
).asValue();
Here OutputTo implements Output and behaves like one, providing write-only access to the encapsulated java.io.File. The TeeInput copies the content of the input to the output. The nnl.rocks.kactoos.io.LengthOf calculates the size of the copied data.
There is no thread-safety guarantee.
See Also
Since 0.1
Name | Summary |
---|---|
stream | abstract fun stream(): OutputStream Get write access to it. |
Name | Summary |
---|---|
CheckedOutput | class CheckedOutput<E> : Output Output that throws exception of specified type. |
DeadOutput | class DeadOutput : Output Output that accepts anything. |
GzipOutput | class GzipOutput : Output Output that writes compressed data in the GZIP file format. |
LoggingOutput | class LoggingOutput : Output Logged output. |
OutputTo | class OutputTo : Output An Output that encapsulates other destination for the data. |
StderrOutput | class StderrOutput : Output Output that writes to stderr . |
StdoutOutput | class StdoutOutput : Output Output that writes to stdout . |
SyncOutput | class SyncOutput : Output Thread-safe Output. |
TeeOutput | class TeeOutput : Output Output to Output copying pipe. |
UncheckedOutput | class UncheckedOutput : Output Input that doesn’t throw checked Exception. |