public static class AbstractOrigin.ReaderOrigin extends AbstractOrigin<Reader,AbstractOrigin.ReaderOrigin>
Reader origin.
This origin cannot provide conversions to other aspects.
AbstractOrigin.AbstractRandomAccessFileOrigin<T extends RandomAccessFile,B extends AbstractOrigin.AbstractRandomAccessFileOrigin<T,B>>, AbstractOrigin.ByteArrayOrigin, AbstractOrigin.CharSequenceOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.IORandomAccessFileOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.RandomAccessFileOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOriginorigin| Constructor and Description |
|---|
ReaderOrigin(Reader origin)
Constructs a new instance for the given origin.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getByteArray()
Gets this origin as a byte array, if possible.
|
CharSequence |
getCharSequence(Charset charset)
Gets this origin as a byte array, if possible.
|
InputStream |
getInputStream(OpenOption... options)
Gets this origin as an InputStream, if possible.
|
Reader |
getReader(Charset charset)
Gets a new Reader on the origin, buffered by default.
|
get, getByteArray, getFile, getOutputStream, getPath, getRandomAccessFile, getWriter, size, toStringasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasSupplier, getUncheckedpublic ReaderOrigin(Reader origin)
origin - The origin, not null.public byte[] getByteArray()
throws IOException
AbstractOrigingetByteArray in class AbstractOrigin<Reader,AbstractOrigin.ReaderOrigin>IOException - if an I/O error occurs.public CharSequence getCharSequence(Charset charset) throws IOException
The charset parameter is ignored since a Reader does not need a Charset to be read.
getCharSequence in class AbstractOrigin<Reader,AbstractOrigin.ReaderOrigin>charset - The charset to use if conversion from bytes is needed.IOException - if an I/O error occurs.public InputStream getInputStream(OpenOption... options) throws IOException
The options parameter is ignored since a Reader does not need an OpenOption to be read.
getInputStream in class AbstractOrigin<Reader,AbstractOrigin.ReaderOrigin>options - options specifying how the file is openedIOException - if an I/O error occurs.public Reader getReader(Charset charset) throws IOException
The charset parameter is ignored since a Reader does not need a Charset to be read.
getReader in class AbstractOrigin<Reader,AbstractOrigin.ReaderOrigin>charset - the charset to use for decoding, null maps to the default Charset.IOException - if an I/O error occurs opening the file.