public void dispose() {
        //according to this: http://download.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html
        //should read all data from connection to make it happy.
        byte[] bytes = new byte[1024];
        try (InputStream in = connection.getInputStream()){
            if(in != null){
                while ((in.read(bytes)) > 0) {}//do nothing
            }
        } catch (Exception ignore) {
            try(InputStream errorStream = connection.getErrorStream()) {
                if(errorStream != null){
                    while ((errorStream.read(bytes)) > 0) {}//do nothing
                }
            } catch (IOException ignoreToo) {}
        }
    }
public void dispose ( ) { byte [ ] bytes = new byte [ 1024 ] ; try ( InputStream in = connection . getInputStream ( ) ) { if ( in != null ) { while ( ( in . read ( bytes ) ) > 0 ) { } } } catch ( Exception ignore ) { try ( InputStream errorStream = connection . getErrorStream ( ) ) { if ( errorStream != null ) { while ( ( errorStream . read ( bytes ) ) > 0 ) { } } } catch ( IOException ignoreToo ) { } } }
This method is already called from {@link #text()} and {@link #bytes()}, you do not have to call it if you use
those methods.
<p></p>
However, if you use {@link #getInputStream()}, call this method in those cases when you think you did
not read entire content from the stream.

<p></p>
This method clears all remaining data in connections after reading a response.
This will help keep-alive work smoothly.