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

(str) String constructors that take ByteBuffer

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE REQUEST :
        
      public String(ByteBuffer bytes, Charset cs);
      public String(ByteBuffer bytes, String csname);
      public int getBytes(byte[] dst, int offset, Charset cs);
      public int getBytes(byte[] dst, int offset, String csname);
      public int getBytes(ByteBuffer bytes, Charset cs);
      public int getBytes(ByteBuffer bytes, String csname);

      JUSTIFICATION :
      When using a direct ByteBuffers it is necessary to create an intermediate byte[] for passing to the constructor for a String. This result is extra potentially buggy code that generates garbage.

        Attachments

          Activity

            People

            • Assignee:
              sherman Xueming Shen
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: