Hadoop Common
  1. Hadoop Common
  2. HADOOP-7437

IOUtils.copybytes will suppress the stream closure exceptions.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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.

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

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development