Avoid using StringBufferappendStringBuffer

CLDC does not include a StringBuffer.append( StringBuffer) method. Appending a string buffer to another in this way creates an intermediate String object. Instead, applications should use net.rim.device.api.util.StringUtilities.append( StringBuffer dst, StringBuffer src[, int offset, int length ] ).

public synchronized StringBuffer append(Object obj) { return append(String.valueOf(obj));

public synchronized StringBuffer append(Object obj) { if (obj instanceof StringBuffer) {

StringBuffer sb = (StringBuffer)obj;

net.rim.device.api.util.StringUtilities.append( this, sb, 0, sb ) return this;

return append(String.valueOf(obj));

0 0

Post a comment

  • Receive news updates via email from this site