/** * Closes the input stream, and "joins" (wait for complete execution * together with potential exception thrown) of the async request. */ @Override public void close() throws IOException { // close super.close(); // "join" async request try { getLastResponse(); } catch (ExecutionException e) { throw new IOException(e.getMessage(), e.getCause()); } catch (InterruptedException e) { throw new IOException(e.getMessage(), e); } }
/** * Closes the input stream, and "joins" (wait for complete execution * together with potential exception thrown) of the async request. */ public void close() throws IOException { // close super.close(); // "join" async request try { getLastResponse(); } catch (Exception e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } }