IOUtils.java (httpcomponents-client-4.5.6-src) | : | IOUtils.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
import org.apache.http.HttpEntity; | import org.apache.http.HttpEntity; | |||
class IOUtils { | class IOUtils { | |||
static void consume(final HttpEntity entity) throws IOException { | static void consume(final HttpEntity entity) throws IOException { | |||
if (entity == null) { | if (entity == null) { | |||
return; | return; | |||
} | } | |||
if (entity.isStreaming()) { | if (entity.isStreaming()) { | |||
final InputStream instream = entity.getContent(); | final InputStream inStream = entity.getContent(); | |||
if (instream != null) { | if (inStream != null) { | |||
instream.close(); | inStream.close(); | |||
} | } | |||
} | } | |||
} | } | |||
static void copy(final InputStream in, final OutputStream out) throws IOExce ption { | static void copy(final InputStream in, final OutputStream out) throws IOExce ption { | |||
final byte[] buf = new byte[2048]; | final byte[] buf = new byte[2048]; | |||
int len; | int len; | |||
while ((len = in.read(buf)) != -1) { | while ((len = in.read(buf)) != -1) { | |||
out.write(buf, 0, len); | out.write(buf, 0, len); | |||
} | } | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |