Class AbortableInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Abortable

    public final class AbortableInputStream
    extends FilterInputStream
    implements Abortable
    Input stream that can be aborted. Abort typically means to destroy underlying HTTP connection without reading more data. This may be desirable when the cost of reading the rest of the data exceeds that of establishing a new connection.
    • Method Detail

      • abort

        public void abort()
        Description copied from interface: Abortable
        Aborts the execution of the task. Multiple calls to abort or calling abort an already aborted task should return without error.
        Specified by:
        abort in interface Abortable
      • delegate

        public InputStream delegate()
        Access the underlying delegate stream, for testing purposes.