Special factory for building documents without any content or structure checking. This should only be used when you are 100% positive that the input is absolutely correct. This factory can speed builds, but any problems in the input will be uncaught until later when they could cause infinite loops, malformed XML, or worse. Use with extreme caution.
A non-public utility class similar to StringBuilder 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 StringBuilder 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 StringBuilder means that no extra unused char array space will be kept around after parsing is through.
@author Bradley S. Huffman
@author Alex Rosen
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.