"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/client/entity/DecompressingEntity.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

DecompressingEntity.java  (httpcomponents-client-4.5.6-src):DecompressingEntity.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 82 skipping to change at line 82
return new LazyDecompressingInputStream(in, inputStreamFactory); return new LazyDecompressingInputStream(in, inputStreamFactory);
} }
@Override @Override
public InputStream getContent() throws IOException { public InputStream getContent() throws IOException {
if (wrappedEntity.isStreaming()) { if (wrappedEntity.isStreaming()) {
if (content == null) { if (content == null) {
content = getDecompressingStream(); content = getDecompressingStream();
} }
return content; return content;
} else {
return getDecompressingStream();
} }
return getDecompressingStream();
} }
@Override @Override
public void writeTo(final OutputStream outstream) throws IOException { public void writeTo(final OutputStream outStream) throws IOException {
Args.notNull(outstream, "Output stream"); Args.notNull(outStream, "Output stream");
final InputStream instream = getContent(); final InputStream inStream = getContent();
try { try {
final byte[] buffer = new byte[BUFFER_SIZE]; final byte[] buffer = new byte[BUFFER_SIZE];
int l; int l;
while ((l = instream.read(buffer)) != -1) { while ((l = inStream.read(buffer)) != -1) {
outstream.write(buffer, 0, l); outStream.write(buffer, 0, l);
} }
} finally { } finally {
instream.close(); inStream.close();
} }
} }
@Override @Override
public Header getContentEncoding() { public Header getContentEncoding() {
/* Content encoding is now 'identity' */ /* Content encoding is now 'identity' */
return null; return null;
} }
@Override @Override
 End of changes. 5 change blocks. 
8 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)