RFR: JDK-8021560,(str) String constructors that take ByteBuffer
xueming.shen at oracle.com
Tue Feb 13 06:24:17 UTC 2018
Please help review the proposal to add following constructors and
methods in String
class to take ByteBuffer as the input and output data buffer.
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, Charset csn);
This is based on the change proposed by Richard in jdk9 time frame .
we were fully occupied by compact string support work back then, this
not make into the top jdk9 priority list.
The implementation in StringCoding class is a little "duplicated" for
of encoding/decoding variants. There is definitely room to further
I would assume it might be better to keep the new code path separated
existing "fully tuned" methods, for now, to avoid possible performance
for existing String methods.
More information about the core-libs-dev