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

Add new read method "toByteArray" to handle InputStream with known size

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4
    • 2.1
    • Utilities
    • None

    Description

      I suggest adding a new method toByteArray(InputStream input, int size) to IoUtils to handle known size InputStream (e.g. files).
      Current implementation based on copy method consumes more memory than necessary (at least the double) to transform a InputStream into a byte array.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            malbini Marco Albini
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment