OutputStream.write(InputStream) and Writer(Reader) to support stream copy

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P5
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • x86
    • linux

      A DESCRIPTION OF THE REQUEST :
      I feel that both byte and character stream copy should be included in the standard API

      JUSTIFICATION :
      This is a wheel I'm constantly re-inventing, and, as far as I can see, a pretty easy hole to fill.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would suggest you consider adding

      int write(InputStream is) throws IOException;

      Method to OutputStream and

      int write(Reader r) throws IOException;

      to Writer (both returning number of elements copied).

      A generic copy method could be placed in the abstract classes, potentially with more optimal copies in derived classes (e.g. Buffered versions).
      ACTUAL -
      DIY, Of course it's only a few lines, but it's one of those things that get's done different ways all the time.

            Assignee:
            Unassigned
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: