Height of Copy Paste Example.
Java StringBuffer / StringBuilder
It seems the author just copied StringBuffer.java to StringBuilder.java, removing all occurrences of "synchronized".
Here is a little trace left in StringBuilder.readObject method:
/**
* readObject is called to restore the state of the StringBuffer from
* a stream.
*/
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
s.defaultReadObject();
count = s.readInt();
value = (char[]) s.readObject();
}
//Copy from Javadoc of Stringbuilder class.
Pankaj
Comments