Code example for CharArrayWriter

Methods: write

0
				menuItemArray.append(JSONObject.quote(attributes.getValue("name"))).append(":");
				firstProperty = false;
			} 
		} 
		public void characters(char[] ch, int start, int length) throws SAXException {
			buf.write(ch, start, length);
		} 
		 
		boolean endSiteElement = false;
		public void endElement(String uri, String localName, String qName) throws SAXException {
			if (qName.equals("site")
					|| (qName.equals("site-top") && !emptySiteTop)) {
//				if(endSiteElement && !close){ 
				if(!close){
					menuItemArray.append("}");
					close = true;
				} 
				idStack.pop();
				endSiteElement = true;
			}else if(qName.equals("properties")){
				menuItemArray.append("}");