public void disconnect() {
        if (this.connection == null) {
            return;
        }

        try {
            if (this.rawInputStream == null) {
                this.rawInputStream = this.connection.getInputStream();
            }

            // We need to manually read from the raw input stream in case there are any remaining bytes. There's a bug
            // where a wrapping GZIPInputStream may not read to the end of a chunked response, causing Java to not
            // return the connection to the connection pool.
            byte[] buffer = new byte[BUFFER_SIZE];
            int n = this.rawInputStream.read(buffer);
            while (n != -1) {
                n = this.rawInputStream.read(buffer);
            }
            this.rawInputStream.close();

            if (this.inputStream != null) {
                this.inputStream.close();
            }
        } catch (IOException e) {
            throw new BoxAPIException("Couldn't finish closing the connection to the Box API due to a network error or "
                + "because the stream was already closed.", e);
        }
    }
public void disconnect ( ) { if ( this . connection == null ) { return ; } try { if ( this . rawInputStream == null ) { this . rawInputStream = this . connection . getInputStream ( ) ; } byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int n = this . rawInputStream . read ( buffer ) ; while ( n != - 1 ) { n = this . rawInputStream . read ( buffer ) ; } this . rawInputStream . close ( ) ; if ( this . inputStream != null ) { this . inputStream . close ( ) ; } } catch ( IOException e ) { throw new BoxAPIException ( "Couldn't finish closing the connection to the Box API due to a network error or " + "because the stream was already closed." , e ) ; } }
Disconnects this response from the server and frees up any network resources. The body of this response can no
longer be read after it has been disconnected.