Class CloseParentResourcesStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class CloseParentResourcesStream
    extends InputStream
    This class allows parent resources (HttpClient and HttpResponse) to be closed when the stream is closed. This becomes necessary when passing an InputStream externally, as postToStreamingOutput does. The parent resources must be closed, but this cannot happen until the InputStream is consumed. It takes a stream, and simply forwards the call to all of its methods, except for the close() method - which does nothing.