package com.electronwill.json;

import java.io.Writer;

/**
 * A Writer which writes in a StringBuilder. This is NOT Thread safe.
 */
public class FastStringWriter extends Writer {
	
	/**
	 * The underlying StringBuilder. Everything is appended to it.
	 */
	private final StringBuilder sb;
	
	/**
	 * Creates a new FastStringWriter with a default StringBuilder
	 */
	public FastStringWriter() {
		sb = new StringBuilder();
	}
	
	/**
	 * Creates a new FastStringWriter with a given StringBuilder. It will append everything to this StringBuilder.
	 *
	 * @param sb the StringBuilder
	 */
	public FastStringWriter(final StringBuilder sb) {
		this.sb = sb;
	}
	
	/**
	 * Returns the underlying StringBuilder.
	 *
	 * @return the underlying StringBuilder
	 */
	public StringBuilder getBuilder() {
		return sb;
	}
	
	/**
	 * Returns the content of the underlying StringBuilder, as a String. Equivalent to {@link #getBuilder()#toString()}.
	 *
	 * @return the content of the underlying StringBuilder
	 */
	@Override
	public String toString() {
		return sb.toString();
	}
	
	@Override
	public FastStringWriter append(char c) {
		sb.append(c);
		return this;
	}
	
	@Override
	public FastStringWriter append(CharSequence csq, int start, int end) {
		sb.append(csq, start, end);
		return this;
	}
	
	@Override
	public FastStringWriter append(CharSequence csq) {
		sb.append(csq);
		return this;
	}
	
	@Override
	public void write(String str, int off, int len) {
		sb.append(str, off, off + len);
	}
	
	@Override
	public void write(String str) {
		sb.append(str);
	}
	
	@Override
	public void write(char[] cbuf, int off, int len) {
		sb.append(cbuf, off, len);
	}
	
	@Override
	public void write(int c) {
		sb.append(c);
	}
	
	/**
	 * This method does nothing.
	 */
	@Override
	public void flush() {}
	
	/**
	 * This method does nothing.
	 */
	@Override
	public void close() {}
	
}

@@ -69,13 +69,12 @@
 ter 
-which
+that
  wri
@@ -101,27 +101,24 @@
 er. 
-This is NOT T
+It isn't t
 hread
- 
+-
 safe
@@ -533,24 +533,25 @@
 Builder.%0A%09 *
+ 
 %0A%09 * @param 
@@ -653,30 +653,27 @@
 %0A%09%0A%09/**%0A%09 * 
-R
+G
 et
-urn
 s the underl
@@ -696,53 +696,8 @@
 er.%0A
-%09 *%0A%09 * @return the underlying StringBuilder%0A
 %09 */
@@ -765,14 +765,11 @@
 %09 * 
-R
+G
 et
-urn
 s th
@@ -876,68 +876,8 @@
 )%7D.%0A
-%09 *%0A%09 * @return the content of the underlying StringBuilder%0A
 %09 */
@@ -1598,37 +1598,25 @@
 %0A%09%0A%09/**%0A%09 * 
-This method d
+D
 oes nothing.
@@ -1671,21 +1671,9 @@
 %09 * 
-This method d
+D
 oes 

Improve doc