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(): OutputStreamGet write access to it. |
| Name | Summary |
|---|---|
| CheckedOutput | class CheckedOutput<E> : OutputOutput that throws exception of specified type. |
| DeadOutput | class DeadOutput : OutputOutput that accepts anything. |
| GzipOutput | class GzipOutput : OutputOutput that writes compressed data in the GZIP file format. |
| LoggingOutput | class LoggingOutput : OutputLogged output. |
| OutputTo | class OutputTo : OutputAn Output that encapsulates other destination for the data. |
| StderrOutput | class StderrOutput : OutputOutput that writes to stderr. |
| StdoutOutput | class StdoutOutput : OutputOutput that writes to stdout. |
| SyncOutput | class SyncOutput : OutputThread-safe Output. |
| TeeOutput | class TeeOutput : OutputOutput to Output copying pipe. |
| UncheckedOutput | class UncheckedOutput : OutputInput that doesn’t throw checked Exception. |