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.