code: private synchronized void writeObject(java.io.ObjectOutputStream s)
          throws java.io.IOException {
          java.io.ObjectOutputStream.PutField fields = s.putFields();
          fields.put("value", getValue());
          fields.put("count", length());
          fields.put("shared", false);
          s.writeFields();
      }
docs: readObject is called to restore the state of the StringBuffer from
  a stream.