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 Reader
asReader()
Obtain aReader
for this readable usingStandardCharsets.UTF_8
.default Reader
Obtain aReader
for this readable.boolean
exists()
Does the underlying readable resource exist.Create aReadable
for the given file.Create aReadable
for the given URL.Create aReadable
for 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 aReader
for this readable usingStandardCharsets.UTF_8
.- Returns:
- The reader
- Throws:
IOException
- if an I/O error occurs
-
asReader
Obtain aReader
for this readable.- Parameters:
charset
- The charset to use- Returns:
- The reader
- Throws:
IOException
- if an I/O error occurs
-
of
Create aReadable
for the given URL.- Parameters:
url
- The URL- Returns:
- The readable.
-
of
Create aReadable
for the given file.- Parameters:
file
- The file- Returns:
- The readable.
-
of
Create aReadable
for the given path.- Parameters:
path
- The path- Returns:
- The readable.
-