question: private String readFully ( HttpURLConnection connection ) throws IOException { String responseBody = "" ; if ( connection . getContentLength ( ) != 0 ) { try { InputStream in = connection . getInputStream ( ) ; if ( in != null ) { responseBody = readStreamData ( in ) ; } } catch ( IOException e ) { InputStream in = connection . getErrorStream ( ) ; if ( in != null ) { responseBody = readStreamData ( in ) ; } else { throw e ; } } } return responseBody ; }
target:  Fully reads the input stream from the passed HTTP URL connection to prevent (harmless) server-side exception.