private void clearInputStream ( HttpURLConnection conn ) { InputStream is = null ; byte [ ] buffer = new byte [ 1024 ] ; try { is = conn . getInputStream ( ) ; while ( is . read ( buffer ) != - 1 ) { continue ; } } catch ( IOException e ) { // Don't care. } finally { if ( is != null ) { try { is . close ( ) ; } catch ( IOException e ) { // Don't care. } } } }
Read the input stream from the connection throw it away and close the connection swallow all exceptions .