Provide a gathering style decoding in java.nio.charset.CharsetDecoder

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      Consider adding the following functionality to java.nio.charset.CharsetDecoder:

      CharsetDecoder#decode(ByteBuffer[] in, CharBuffer out, boolean endOfInput)

      What we already have is this:

      CharsetDecoder#decode(ByteBuffer in, CharBuffer out, boolean endOfInput)

      The rationale behind the proposed method is to facilitate a scenario where an input sequence of bytes is spread across several byte buffers. Typically such sequences originate from consecutive reads or a single gathering read from a channel.

      Currently in such cases additional rearrangement of buffers is required. Which leads to a copy-pasted and error-prone code in sources and additional allocation and copying at runtime.

      ------------------
      (originated from http://mail.openjdk.java.net/pipermail/nio-dev/2016-March/003588.html)

            Assignee:
            Unassigned
            Reporter:
            Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: