Code example for StringBuilder

Methods: lengthtoString, delete

0
			try { 
				boolean append = true;
				if (mNumFlushes == 0)
					append = false;
				FileWriter writer = new FileWriter(mFile, append);
				writer.write(mBuilder.toString());
				mBuilder.delete(0, mBuilder.length());
				writer.flush();
				writer.close();
				mNumFlushes++;
			} catch (IOException e) {
			} 
		} 
 
		public void stopTracking() { 
			if (mTracking) {
				mBuilder.append("</DSLVStates>\n");
				flush(); 
				mTracking = false;
			} 
Contextual code suggestions in your IDE  Get Codota for Java