You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org> on 2011/07/01 06:57:28 UTC

[jira] [Created] (HADOOP-7437) IOUtils.copybytes will suppress the stream closure exception.

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