1 // natStringBuffer.cc - Implementation of java.lang.StringBuffer native methods.
3 /* Copyright (C) 2001, 2003 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
13 #include <java/lang/StringBuffer.h>
15 java::lang::StringBuffer*
16 java::lang::StringBuffer::append (jint num)
18 // Use an array large enough for "-2147483648"; i.e. 11 chars.
20 int i = _Jv_FormatInt (buffer+11, num);
21 JvSynchronize dummy (this);
22 jint needed = count + i;
23 ensureCapacity_unsynchronized (needed);
24 jchar* dst = elements (value) + count;
25 jchar* src = buffer+11-i;
33 java::lang::StringBuffer::regionMatches(jint toffset, jstring other)
35 jint len = other->count;
36 jchar *tptr = elements(value) + toffset;
37 jchar *optr = JvGetStringChars(other);
39 if (*tptr++ != *optr++)