public interface Input
Here is for example how Input
can be used
in order to read the content of a text file:
String content = new BytesAsText( new InputAsBytes( new FileAsInput(new File("/tmp/names.txt")) ) ).asString();
Here FileAsInput
implements Input
and behaves like
one, providing read-only access to the encapsulated File
.
There is no thread-safety guarantee.
Modifier and Type | Method and Description |
---|---|
InputStream |
stream()
Get read access to it.
|
InputStream stream() throws IOException
IOException
- If something goes wrongCopyright © 2017 Cactoos. All rights reserved.