Description
public static void copyBytes(InputStream in, OutputStream out, long count, boolean close) throws IOException { byte buf[] = new byte[4096]; long bytesRemaining = count; int bytesRead; try { ............. ............. } finally { if (close) { closeStream(out); closeStream(in); } } }
Here if any exception in closing the stream, it will get suppressed here.
So, better to follow the stream closure pattern as HADOOP-7194.
Attachments
Attachments
Issue Links
- is broken by
-
HADOOP-7429 Add another IOUtils#copyBytes method
- Resolved
- is related to
-
HADOOP-7194 Potential Resource leak in IOUtils.java
- Closed