Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-101

If InputStream.close() fails, OutStream is not closed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0-alpha-3
    • 1.0.0-alpha-2
    • None
    • None

      IOUtil has:

      /**

      • Copies the contents from an InputStream to an OutputStream and closes both streams.
      • @param input
      • @param output
        */
        public static void copyWithClose(InputStream input, OutputStream output)
        {
        try { copy(input, output); }

        finally
        {
        try

        { input.close(); output.close(); }

        catch (final IOException ignore)
        {

      }
      }
      }

      Attempt a close on "output" in a separate block. Some logging at trace level on IOExceptions couldn't hurt either.

              arubinge@redhat.com Andrew Rubinger (Inactive)
              arubinge@redhat.com Andrew Rubinger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: