Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-7437

IOUtils.copybytes will suppress the stream closure exceptions.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: hudson, 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      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

        1. HADOOP-7437.patch
          3 kB
          Uma Maheswara Rao G

          Issue Links

            Activity

              People

              • Assignee:
                umamaheswararao Uma Maheswara Rao G
                Reporter:
                umamaheswararao Uma Maheswara Rao G
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: