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/AbstractStringBuffer.h>
15 java::lang::AbstractStringBuffer*
16 java::lang::AbstractStringBuffer::append (jint num)
18 // Use an array large enough for "-2147483648"; i.e. 11 chars.
20 int i = _Jv_FormatInt (buffer+11, num);
21 jint needed = count + i;
22 ensureCapacity_unsynchronized (needed);
23 jchar* dst = elements (value) + count;
24 jchar* src = buffer+11-i;
32 java::lang::AbstractStringBuffer::regionMatches(jint toffset, jstring other)
34 jint len = other->count;
35 jchar *tptr = elements(value) + toffset;
36 jchar *optr = JvGetStringChars(other);
38 if (*tptr++ != *optr++)