hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswara Rao G (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-7437) IOUtils.copybytes will suppress the stream closure exception.
Date Fri, 01 Jul 2011 04:57:28 GMT
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

        

Mime
View raw message