Public Member Functions | |
TextBuffer () | |
void | append (char[] source, int start, int count) |
int | size () |
void | clear () |
String | toString () |
TextBuffer
is similar to StringBuffer, but optimized for XML parsing, where the common case is that you get only one chunk of characters per text section. TextBuffer
stores the first chunk of characters in a String, which can just be returned directly if no second chunk is received. Subsequent chunks are stored in a supplemental char array (like StringBuffer uses). In this case, the returned text will be the first String chunk, concatenated with the subsequent chunks stored in the char array. This provides optimal performance in the common case, while still providing very good performance in the uncommon case. Furthermore, avoiding StringBuffer means that no extra unused char array space will be kept around after parsing is through.
Alex Rosen
|
Constructor |
|
Append the specified text to the text value of this buffer. |
|
Clears the text value and prepares the TextBuffer for reuse. |
|
Returns the size of the text value. |
|
Returns the text value stored in the buffer. |