Class BoundedInputStream.AbstractBuilder<T extends BoundedInputStream.AbstractBuilder<T>>

    • Field Detail

      • count

        private long count
        The current count of bytes counted.
      • maxCount

        private long maxCount
        The max count of bytes to read.
    • Constructor Detail

      • AbstractBuilder

        AbstractBuilder()
    • 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 the BoundedInputStream.close() method should propagate to the underling InputStream.

        Default is true.

        Parameters:
        propagateClose - true if calling BoundedInputStream.close() propagates to the close() method of the underlying stream or false if it does not.
        Returns:
        this.