Package io.micronaut.core.io
Interface Readable
- All Superinterfaces:
Named
- Since:
- 1.1.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionRepresent this Readable as an input stream.default ReaderasReader()Obtain aReaderfor this readable usingStandardCharsets.UTF_8.default ReaderObtain aReaderfor this readable.booleanexists()Does the underlying readable resource exist.Create aReadablefor the given file.Create aReadablefor the given URL.Create aReadablefor the given path.
-
Method Details
-
asInputStream
Represent this Readable as an input stream.- Returns:
- The input stream
- Throws:
IOException- if an I/O exception occurs
-
exists
boolean exists()Does the underlying readable resource exist.- Returns:
- True if it does
-
asReader
Obtain aReaderfor this readable usingStandardCharsets.UTF_8.- Returns:
- The reader
- Throws:
IOException- if an I/O error occurs
-
asReader
Obtain aReaderfor this readable.- Parameters:
charset- The charset to use- Returns:
- The reader
- Throws:
IOException- if an I/O error occurs
-
of
Create aReadablefor the given URL.- Parameters:
url- The URL- Returns:
- The readable.
-
of
Create aReadablefor the given file.- Parameters:
file- The file- Returns:
- The readable.
-
of
Create aReadablefor the given path.- Parameters:
path- The path- Returns:
- The readable.
-