Package org.cactoos
Interface Input
-
- All Known Implementing Classes:
CheckedInput
,CloseShieldInput
,DeadInput
,GzipInput
,HeadOf
,InputNoNulls
,InputOf
,InputWithFallback
,Joined
,LoggingInput
,ResourceOf
,Stdin
,Sticky
,SyncInput
,TailOf
,TeeInput
,UncheckedInput
,Zip
- 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 Input
Input.Here is for example how
Input
can be used in order to read the content of a text file:String content = new TextOf( new InputOf(new File("/tmp/names.txt")) ).asString();
Here
InputOf
implementsInput
and behaves like one, providing read-only access to the encapsulatedFile
.There is no thread-safety guarantee.
- Since:
- 0.1
- See Also:
InputOf
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
stream()
Get read access to it.
-
-
-
Method Detail
-
stream
InputStream stream() throws Exception
Get read access to it.- Returns:
- InputStream to read from
- Throws:
Exception
- If something goes wrong
-
-