Package org.cactoos
Interface Output
-
- All Known Implementing Classes:
AppendTo
,CheckedOutput
,CloseShieldOutput
,DeadOutput
,GzipOutput
,LoggingOutput
,OutputNoNulls
,OutputTo
,Stderr
,Stdout
,SyncOutput
,TeeOutput
,UncheckedOutput
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Output
Output.Here is for example how
Output
can be used together withInput
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
implementsOutput
and behaves like one, providing write-only access to the encapsulatedFile
. TheTeeInput
copies the content of the input to the output. TheLengthOf
calculates the size of the copied data.There is no thread-safety guarantee.
- Since:
- 0.1
- See Also:
OutputTo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
stream()
Get write access to it.
-
-
-
Method Detail
-
stream
OutputStream stream() throws Exception
Get write access to it.- Returns:
- OutputStream to write to
- Throws:
Exception
- If something goes wrong
-
-