void setPrefix(final CharSequence prefix, CharSequence uri,
boolean isWritten) {
final int index = _namespacesCount[_nesting];
_prefixesWritten[index] = isWritten;
final int prefixLength = prefix.length();
CharArray prefixTmp = _prefixesTmp[index];
if ((prefixTmp == null)
|| (prefixTmp.array().length < prefixLength)) {
MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
public void run() {
_prefixesTmp[index] = new CharArray().setArray(new char[prefixLength + 32], 0, 0);
}
});
prefixTmp = _prefixesTmp[index];
}
for (int i = 0; i < prefixLength; i++) {
prefixTmp.array()[i] = prefix.charAt(i);
}
prefixTmp.setArray(prefixTmp.array(), 0, prefixLength);
final int uriLength = uri.length();
CharArray namespaceTmp = _namespacesTmp[index];
if ((namespaceTmp == null)
|| (namespaceTmp.array().length < uriLength)) {
MemoryArea.getMemoryArea(this).executeInArea(new Runnable() {
public void run() {
_namespacesTmp[index] = new CharArray().setArray(new char[uriLength + 32], 0, 0);
}
});
namespaceTmp = _namespacesTmp[index];
}
for (int i = 0; i < uriLength; i++) {
namespaceTmp.array()[i] = uri.charAt(i);
}
namespaceTmp.setArray(namespaceTmp.array(), 0, uriLength);
// Sets the prefix using CharArray instances.
setPrefix(prefixTmp, namespaceTmp);
}