Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-753

Provide a IOUtils.copy(OutputStream, InputStream)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • Utilities
    • None

    Description

      We already have several copy(InputStream, OutputStream) methods, but often the other way round is necessary - i.e. providing an InputStream on data provided by an OutputStream.

      This is e.g. the case when one is using a serialization library (for example, serializing to JSON) and a transport layer (say, Tomcat) which takes an InputStream. So you need to pipe the OutputStream from JSON over an HTTP connection which wants to read from an InputStream.

      My particular use-case is that I want to provide an Excel file (generated via POI) at my web-application. POI can write a workbook to an OutputStream, but I need to provide that Excel as an InputStream to my Web-Framework (Vaadin), so users can download it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sebastian.Dietrich Sebastian Dietrich
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m