< prev index next >
src/java.base/share/classes/java/lang/AbstractStringBuilder.java
Print this page
*** 96,107 ****
int compareTo(AbstractStringBuilder another) {
if (this == another) {
return 0;
}
! byte val1[] = value;
! byte val2[] = another.value;
int count1 = this.count;
int count2 = another.count;
if (coder == another.coder) {
return isLatin1() ? StringLatin1.compareTo(val1, val2, count1, count2)
--- 96,107 ----
int compareTo(AbstractStringBuilder another) {
if (this == another) {
return 0;
}
! byte[] val1 = value;
! byte[] val2 = another.value;
int count1 = this.count;
int count2 = another.count;
if (coder == another.coder) {
return isLatin1() ? StringLatin1.compareTo(val1, val2, count1, count2)
*** 675,685 ****
* @return a reference to this object.
* @throws IndexOutOfBoundsException
* if {@code offset < 0} or {@code len < 0}
* or {@code offset+len > str.length}
*/
! public AbstractStringBuilder append(char str[], int offset, int len) {
int end = offset + len;
checkRange(offset, end, str.length);
ensureCapacityInternal(count + len);
appendChars(str, offset, end);
return this;
--- 675,685 ----
* @return a reference to this object.
* @throws IndexOutOfBoundsException
* if {@code offset < 0} or {@code len < 0}
* or {@code offset+len > str.length}
*/
! public AbstractStringBuilder append(char[] str, int offset, int len) {
int end = offset + len;
checkRange(offset, end, str.length);
ensureCapacityInternal(count + len);
appendChars(str, offset, end);
return this;
*** 1590,1600 ****
* 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.inflate(value, 0, dst, dstBegin, count);
}
--- 1590,1600 ----
* 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.inflate(value, 0, dst, dstBegin, count);
}
< prev index next >