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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 9
    • 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)

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

              Created:
              Updated: