| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
asInputStream()
Represent this Readable as an input stream.
|
default java.io.Reader |
asReader()
Obtain a
Reader for this readable using StandardCharsets.UTF_8. |
default java.io.Reader |
asReader(java.nio.charset.Charset charset)
Obtain a
Reader for this readable. |
boolean |
exists()
Does the underlying readable resource exist.
|
static Readable |
of(java.io.File file)
Create a
Readable for the given file. |
static Readable |
of(java.nio.file.Path path)
Create a
Readable for the given path. |
static Readable |
of(java.net.URL url)
Create a
Readable for the given URL. |
@NonNull java.io.InputStream asInputStream() throws java.io.IOException
java.io.IOException - if an I/O exception occursboolean exists()
default java.io.Reader asReader()
throws java.io.IOException
Reader for this readable using StandardCharsets.UTF_8.java.io.IOException - if an I/O error occursdefault java.io.Reader asReader(java.nio.charset.Charset charset)
throws java.io.IOException
Reader for this readable.charset - The charset to usejava.io.IOException - if an I/O error occurs@NonNull static Readable of(@NonNull java.net.URL url)
Readable for the given URL.url - The URL@NonNull static Readable of(@NonNull java.io.File file)
Readable for the given file.file - The file