public static class ReadAheadInputStream.Builder extends AbstractStreamBuilder<ReadAheadInputStream,ReadAheadInputStream.Builder>
ReadAheadInputStream.
For example:
ReadAheadInputStream s = ReadAheadInputStream.builder()
.setPath(path)
.setExecutorService(Executors.newSingleThreadExecutor(ReadAheadInputStream::newThread))
.get();
get()| Constructor and Description |
|---|
Builder()
Constructs a new builder of
ReadAheadInputStream. |
| Modifier and Type | Method and Description |
|---|---|
ReadAheadInputStream |
get()
Builds a new
ReadAheadInputStream. |
ReadAheadInputStream.Builder |
setExecutorService(java.util.concurrent.ExecutorService executorService)
Sets the executor service for the read-ahead thread.
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeMax, setCharset, setCharset, setOpenOptionssetByteArray, setCharSequence, setFile, setFile, setInputStream, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, getUncheckedpublic Builder()
ReadAheadInputStream.public ReadAheadInputStream get() throws java.io.IOException
ReadAheadInputStream.
You must set an aspect that supports AbstractStreamBuilder.getInputStream(), otherwise, this method throws an exception.
This builder uses the following aspects:
AbstractStreamBuilder.getInputStream() gets the target aspect.AbstractStreamBuilder.getBufferSize()ExecutorServicejava.lang.IllegalStateException - if the origin is null.java.lang.UnsupportedOperationException - if the origin cannot be converted to an InputStream.java.io.IOException - if an I/O error occurs converting to an InputStream using AbstractStreamBuilder.getInputStream().AbstractStreamBuilder.getInputStream(),
AbstractStreamBuilder.getBufferSize(),
IOSupplier.getUnchecked()public ReadAheadInputStream.Builder setExecutorService(java.util.concurrent.ExecutorService executorService)
executorService - the executor service for the read-ahead thread.this instance.Copyright © 2010 - 2025 Adobe. All Rights Reserved