public static class QueueInputStream.Builder extends AbstractStreamBuilder<QueueInputStream,QueueInputStream.Builder>
QueueInputStream
instance.
For example:
QueueInputStream s = QueueInputStream.builder()
.setBlockingQueue(new LinkedBlockingQueue<>())
.setTimeout(Duration.ZERO)
.get();
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.BlockingQueue<java.lang.Integer> |
blockingQueue |
private java.time.Duration |
timeout |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
QueueInputStream |
get()
Constructs a new instance.
|
QueueInputStream.Builder |
setBlockingQueue(java.util.concurrent.BlockingQueue<java.lang.Integer> blockingQueue)
Sets backing queue for the stream.
|
QueueInputStream.Builder |
setTimeout(java.time.Duration timeout)
Sets the polling timeout.
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getInputStream, getOpenOptions, getOutputStream, getPath, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, 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
private java.util.concurrent.BlockingQueue<java.lang.Integer> blockingQueue
private java.time.Duration timeout
public QueueInputStream get()
This builder use the aspects BlockingQueue and timeout.
public QueueInputStream.Builder setBlockingQueue(java.util.concurrent.BlockingQueue<java.lang.Integer> blockingQueue)
blockingQueue
- backing queue for the stream.public QueueInputStream.Builder setTimeout(java.time.Duration timeout)
timeout
- the polling timeout.