boolean (StringBuffer buffer) { synchronized (buffer) { if (count != buffer.count) return false; if (value == buffer.value) return true; // Possible if shared. int i = count; int x = offset + count; while (--i >= 0) if (value[--x] != buffer.value[i]) return false; return true; } }