Class BoundedReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

    public class BoundedReader
    extends Reader
    A reader that imposes a limit to the number of bytes that can be read from an underlying reader, simulating eof when this limit is reached. This stream can typically be used to constrain a client with regard to a readAheadLimit of an underlying stream, to avoid overrunning this limit and hence lose the opportunity do to reset.