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

IOUtils.copybytes will suppress the stream closure exceptions.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • hudson, 0.23.0
    • 0.23.0
    • io
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: