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

Popular posts from this blog

Step by step guide on how to pay Income Tax that is due

Simple way producer–consumer problem's implementation in NodeJs

Rajiv Gandhi Equity Savings Scheme