Code example for CharArrayWriter

Methods: write

0
			throws SAXException { 
		if (itemCount >= maxCount)
			return; 
//		if (contentsLevel > 1) { 
			try { 
				charBuf.write("<!--");
				charBuf.write(ch, start, length);
				charBuf.write("-->");
			} catch (IOException e) {
				throw new SAXException(e);
			} 
//		} 
	} 
 
	public void startCDATA() throws SAXException { 
		if (itemCount >= maxCount)
			return; 
//		if (contentsLevel > 1) { 
		if (isUnknownTag) {
			try { 
				charBuf.write("<![CDATA[");