/** * Returns the response content as an input stream. * @return the response content as an input stream * @throws IOException in case of IOProblems */ public InputStream getContentAsStream() throws IOException { return responseData_.getInputStream(); }
/** * {@inheritDoc} */ public InputStream getContentAsStream() throws IOException { return responseData_.getInputStream(); }
/** * Returns the response content as an input stream. * @return the response content as an input stream * @throws IOException in case of IOProblems */ public InputStream getContentAsStream() throws IOException { return responseData_.getInputStream(); }
/** * Returns the response body. * This may cause memory problem for very large responses. * @return response body */ public byte[] getBody() { try (InputStream is = getInputStream()) { return IOUtils.toByteArray(is); } catch (final IOException e) { throw new RuntimeException(e); // shouldn't we allow the method to throw IOException? } }
/** * Returns the response body. * This may cause memory problem for very large responses. * @return response body */ public byte[] getBody() { try { return IOUtils.toByteArray(getInputStream()); } catch (final IOException e) { throw new RuntimeException(e); // shouldn't we allow the method to throw IOException? } }
/** * Returns the response body. * This may cause memory problem for very large responses. * @return response body */ public byte[] getBody() { try (InputStream is = getInputStream()) { return IOUtils.toByteArray(is); } catch (final IOException e) { throw new RuntimeException(e); // shouldn't we allow the method to throw IOException? } }
try (InputStream in = responseData_.getInputStream()) { if (in != null) { try (BOMInputStream bomIn = new BOMInputStream(in, BOM_HEADERS)) {
try (InputStream in = responseData_.getInputStream()) { if (in != null) { try (BOMInputStream bomIn = new BOMInputStream(in, BOM_HEADERS)) {