src/share/classes/java/lang/StringCoding.java
Print this page
rev 5431 : 6924259: Remove offset and count fields from java.lang.String
Summary: Removes the use of shared character array buffers by String along with the two fields needed to support the use of shared buffers.
Contributed-by: brian.doherty@oracle.com
*** 248,257 ****
--- 248,258 ----
}
static char[] decode(byte[] ba, int off, int len) {
String csn = Charset.defaultCharset().name();
try {
+ // use charset name decode() variant which provides caching.
return decode(csn, ba, off, len);
} catch (UnsupportedEncodingException x) {
warnUnsupportedCharset(csn);
}
try {
*** 380,389 ****
--- 381,391 ----
}
static byte[] encode(char[] ca, int off, int len) {
String csn = Charset.defaultCharset().name();
try {
+ // use charset name encode() variant which provides caching.
return encode(csn, ca, off, len);
} catch (UnsupportedEncodingException x) {
warnUnsupportedCharset(csn);
}
try {