public static class ReaderInputStream.Builder extends org.apache.commons.io.build.AbstractStreamBuilder<ReaderInputStream,ReaderInputStream.Builder>
ReaderInputStream instance.
For example:
ReaderInputStream s = ReaderInputStream.builder()
.setPath(path)
.setCharsetEncoder(Charset.defaultCharset().newEncoder())
.get();
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ReaderInputStream |
get()
Constructs a new instance.
|
ReaderInputStream.Builder |
setCharset(java.nio.charset.Charset charset) |
ReaderInputStream.Builder |
setCharsetEncoder(java.nio.charset.CharsetEncoder newEncoder)
Sets the charset encoder.
|
getCharset, setBufferSize, setBufferSize, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplierpublic ReaderInputStream get() throws java.io.IOException
This builder use the aspects Reader, Charset, CharsetEncoder, buffer size.
You must provide an origin that can be converted to a Reader by this builder, otherwise, this call will throw an
UnsupportedOperationException.
java.lang.UnsupportedOperationException - if the origin cannot provide a Reader.java.lang.IllegalStateException - if the origin is null.java.io.IOException - if an I/O error occurs.AbstractOrigin.getReader(Charset)public ReaderInputStream.Builder setCharset(java.nio.charset.Charset charset)
setCharset in class org.apache.commons.io.build.AbstractStreamBuilder<ReaderInputStream,ReaderInputStream.Builder>public ReaderInputStream.Builder setCharsetEncoder(java.nio.charset.CharsetEncoder newEncoder)
newEncoder - the charset encoder, null resets to a default encoder.Copyright © 2010 - 2023 Adobe. All Rights Reserved