T - The subclass.abstract static class BoundedInputStream.AbstractBuilder<T extends BoundedInputStream.AbstractBuilder<T>> extends ProxyInputStream.AbstractBuilder<BoundedInputStream,T>
BoundedInputStream subclassses.| Constructor and Description |
|---|
AbstractBuilder() |
| Modifier and Type | Method and Description |
|---|---|
(package private) long |
getCount() |
(package private) long |
getMaxCount() |
(package private) IOBiConsumer<Long,Long> |
getOnMaxCount() |
(package private) boolean |
isPropagateClose() |
T |
setCount(long count)
Sets the current number of bytes counted.
|
T |
setMaxCount(long maxCount)
Sets the maximum number of bytes to return.
|
T |
setOnMaxCount(IOBiConsumer<Long,Long> onMaxCount)
Sets the default
BoundedInputStream.onMaxLength(long, long) behavior, null resets to a NOOP. |
T |
setPropagateClose(boolean propagateClose)
Sets whether the
ProxyInputStream.close() method should propagate to the underling InputStream. |
getAfterRead, setAfterReadgetBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionscheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, get, getUncheckedlong getCount()
long getMaxCount()
IOBiConsumer<Long,Long> getOnMaxCount()
boolean isPropagateClose()
public T setCount(long count)
Useful when building from another stream to carry forward a read count.
Default is 0, negative means 0.
count - The current number of bytes counted.this instance.public T setMaxCount(long maxCount)
Default is IOUtils.EOF, negative means unbound.
maxCount - The maximum number of bytes to return, negative means unbound.this instance.public T setOnMaxCount(IOBiConsumer<Long,Long> onMaxCount)
BoundedInputStream.onMaxLength(long, long) behavior, null resets to a NOOP.
The first Long is the max count of bytes to read. The second Long is the count of bytes read.
This does not override a BoundedInputStream subclass' implementation of the BoundedInputStream.onMaxLength(long, long)
method.
onMaxCount - the ProxyInputStream.afterRead(int) behavior.public T setPropagateClose(boolean propagateClose)
ProxyInputStream.close() method should propagate to the underling InputStream.
Default is true.
propagateClose - true if calling ProxyInputStream.close() propagates to the close() method of the underlying stream or false if
it does not.this instance.