IOUtils.copybytes will suppress the stream closure exception. 
--------------------------------------------------------------

                 Key: HADOOP-7437
                 URL: https://issues.apache.org/jira/browse/HADOOP-7437
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Uma Maheswara Rao G
            Assignee: Uma Maheswara Rao G


{code}

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);
      }
    }
  }

{code}

Here if any exception in closing the stream, it will get suppressed here.

So, better to follow the stream closure pattern as HADOOP-7194.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to