标签:array 简单的 system ase base int value etc import
package com.letv.test.base;
import java.util.Arrays;
public class StringBuffer {
private char[] value;
private int count;
public StringBuffer() {
value = new char[16];
count = 0;
}
public StringBuffer(String str) {
value = Arrays.copyOf(str.toCharArray(), str.length() + 16);
count = str.length();
}
public synchronized StringBuffer appen(String str) {
if (count + str.length() > value.length) {
value = Arrays.copyOf(value, count + str.length() + 16);
}
System.arraycopy(str.toCharArray(), 0, value, count, str.length());
// str.getChars(0, str.length(), value, count);
count = count + str.length();
return this;
}
}
标签:array 简单的 system ase base int value etc import
原文地址:https://www.cnblogs.com/dava/p/9593907.html