Package org.apache.commons.io.input
Class BoundedInputStream.AbstractBuilder<T extends BoundedInputStream.AbstractBuilder<T>>
- java.lang.Object
-
- org.apache.commons.io.build.AbstractSupplier<T,B>
-
- org.apache.commons.io.build.AbstractOriginSupplier<T,B>
-
- org.apache.commons.io.build.AbstractStreamBuilder<BoundedInputStream,T>
-
- org.apache.commons.io.input.BoundedInputStream.AbstractBuilder<T>
-
- Type Parameters:
T- The subclass.
- All Implemented Interfaces:
IOSupplier<BoundedInputStream>
- Direct Known Subclasses:
BoundedInputStream.Builder
- Enclosing class:
- BoundedInputStream
abstract static class BoundedInputStream.AbstractBuilder<T extends BoundedInputStream.AbstractBuilder<T>> extends AbstractStreamBuilder<BoundedInputStream,T>
For subclassing builders fromBoundedInputStreamsubclassses.
-
-
Field Summary
Fields Modifier and Type Field Description private longcountThe current count of bytes counted.private longmaxCountThe max count of bytes to read.private booleanpropagateCloseFlag ifBoundedInputStream.close()should be propagated,trueby default.
-
Constructor Summary
Constructors Constructor Description AbstractBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) longgetCount()(package private) longgetMaxCount()(package private) booleanisPropagateClose()TsetCount(long count)Sets the current number of bytes counted.TsetMaxCount(long maxCount)Sets the maximum number of bytes to return.TsetPropagateClose(boolean propagateClose)Sets whether theBoundedInputStream.close()method should propagate to the underlingInputStream.-
Methods inherited from class org.apache.commons.io.build.AbstractStreamBuilder
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getInputStream, getOpenOptions, getOutputStream, getPath, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptions
-
Methods inherited from class org.apache.commons.io.build.AbstractOriginSupplier
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
-
Methods inherited from class org.apache.commons.io.build.AbstractSupplier
asThis
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.io.function.IOSupplier
asSupplier, get
-
-
-
-
Field Detail
-
count
private long count
The current count of bytes counted.
-
maxCount
private long maxCount
The max count of bytes to read.
-
propagateClose
private boolean propagateClose
Flag ifBoundedInputStream.close()should be propagated,trueby default.
-
-
Method Detail
-
getCount
long getCount()
-
getMaxCount
long getMaxCount()
-
isPropagateClose
boolean isPropagateClose()
-
setCount
public T setCount(long count)
Sets the current number of bytes counted.Useful when building from another stream to carry forward a read count.
Default is
0, negative means 0.- Parameters:
count- The current number of bytes counted.- Returns:
- this.
-
setMaxCount
public T setMaxCount(long maxCount)
Sets the maximum number of bytes to return.Default is -1, negative means unbound.
- Parameters:
maxCount- The maximum number of bytes to return.- Returns:
- this.
-
setPropagateClose
public T setPropagateClose(boolean propagateClose)
Sets whether theBoundedInputStream.close()method should propagate to the underlingInputStream.Default is
true.- Parameters:
propagateClose-trueif callingBoundedInputStream.close()propagates to theclose()method of the underlying stream orfalseif it does not.- Returns:
- this.
-
-