public static class ReadAheadInputStream.Builder extends org.apache.commons.io.build.AbstractStreamBuilder<ReadAheadInputStream,ReadAheadInputStream.Builder>
ReadAheadInputStream instance.
For example:
ReadAheadInputStream s = ReadAheadInputStream.builder()
.setPath(path)
.setExecutorService(Executors.newSingleThreadExecutor(ReadAheadInputStream::newThread))
.get();
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ReadAheadInputStream |
get()
Constructs a new instance.
|
ReadAheadInputStream.Builder |
setExecutorService(java.util.concurrent.ExecutorService executorService)
Sets the executor service for the read-ahead thread.
|
getCharset, setBufferSize, setBufferSize, setCharset, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplierpublic ReadAheadInputStream get() throws java.io.IOException
This builder use the aspects InputStream, OpenOption[], buffer size, ExecutorService.
You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an
UnsupportedOperationException.
java.lang.UnsupportedOperationException - if the origin cannot provide an InputStream.java.io.IOException - if an I/O error occurs.AbstractStreamBuilder.getInputStream()public ReadAheadInputStream.Builder setExecutorService(java.util.concurrent.ExecutorService executorService)
executorService - the executor service for the read-ahead thread.Copyright © 2010 - 2023 Adobe. All Rights Reserved