Class LimitedOutputStream

    • Constructor Detail

      • LimitedOutputStream

        public LimitedOutputStream​(OutputStream out,
                                   int limit)
        Parameters:
        out - an output stream that will receive the "trucated" stream.
        limit - a positive integer of the number of bytes to be passed to the underlying stream
    • Method Detail

      • getComputedBytes

        public int getComputedBytes()
        Returns:
        the number of bytes passed to the underlying stream
      • isLimited

        public boolean isLimited()
        Returns:
        true if the limit has been reached and no data is being passed to the underlying stream.