Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6363656

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 5.0
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: