src/java.base/share/classes/java/lang/AbstractStringBuilder.java

Print this page

        

*** 1582,1601 **** * coders are different and the dstBegin has enough space * * @param dstBegin the char index, not offset of byte[] * @param coder the coder of dst[] */ ! protected void getBytes(byte dst[], int dstBegin, byte coder) { if (this.coder == coder) { System.arraycopy(value, 0, dst, dstBegin << coder, count << coder); } else { // this.coder == LATIN && coder == UTF16 StringLatin1.inflateSB(value, dst, dstBegin, count); } } /* for readObject() */ ! protected void initBytes(char[] value, int off, int len) { if (String.COMPACT_STRINGS) { this.value = StringUTF16.compress(value, off, len); if (this.value != null) { this.coder = LATIN1; return; --- 1582,1601 ---- * coders are different and the dstBegin has enough space * * @param dstBegin the char index, not offset of byte[] * @param coder the coder of dst[] */ ! void getBytes(byte dst[], int dstBegin, byte coder) { if (this.coder == coder) { System.arraycopy(value, 0, dst, dstBegin << coder, count << coder); } else { // this.coder == LATIN && coder == UTF16 StringLatin1.inflateSB(value, dst, dstBegin, count); } } /* for readObject() */ ! void initBytes(char[] value, int off, int len) { if (String.COMPACT_STRINGS) { this.value = StringUTF16.compress(value, off, len); if (this.value != null) { this.coder = LATIN1; return;