public static class ReadAheadInputStream.Builder extends 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(ExecutorService executorService)
Sets the executor service for the read-ahead thread.
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getInputStream, getOpenOptions, getOutputStream, getPath, getWriter, setBufferSize, setBufferSize, setBufferSizeDefault, setCharset, setCharset, setCharsetDefault, setOpenOptions
checkOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setReader, setURI, setWriter
asThis
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asSupplier
public Builder()
public ReadAheadInputStream get() throws 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
.
UnsupportedOperationException
- if the origin cannot provide an InputStream.IOException
- if an I/O error occurs.AbstractStreamBuilder.getInputStream()
public ReadAheadInputStream.Builder setExecutorService(ExecutorService executorService)
executorService
- the executor service for the read-ahead thread.Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.