private static InputStream getInputStream(final CloseableHttpResponse response) throws IOException {
final InputStream inputStream;
if (response.getEntity() == null) {
inputStream = new ByteArrayInputStream(new byte[0]);
} else {
final InputStream i = response.getEntity().getContent();
if (i.markSupported()) {
inputStream = i;
} else {
inputStream = new BufferedInputStream(i, ReaderWriter.BUFFER_SIZE);
}
}
return new FilterInputStream(inputStream) {
@Override
public void close() throws IOException {
response.close();
super.close();
}
};
}
ApacheConnector.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:FoDBugTrackerUtility
作者:
评论列表
文章目录