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

ReaderInputStream optimization: more efficient reading of small chunks of data

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None

      Description

      ReaderInputStream in its current form does not efficiently handle reading of small data chunks. #read(byte[] b, int off, int len) methods compacts encoderOut on every read operation, which is not very efficient if the chunks of data being read are smallish. This especially affects the #read() method, which currently reads one byte of data into a temporary byte array. Not to mention that allocation of a temporary byte array on each #read() method invocation leads to generation of unnecessary intermediate garbage on the heap.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              olegk Oleg Kalnichevski
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: