org.codehaus.groovy.grails.web.pages
Class FastStringWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.codehaus.groovy.grails.web.pages.FastStringWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class FastStringWriter
extends Writer

Java's default StringWriter uses a StringBuffer which is synchronized. This implementation uses StringBuilder which doesn't use synchronization

Since:
1.1

Created: Jan 20, 2009

Author:
Graeme Rocher

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
  FastStringWriter()
           
protected FastStringWriter(Object o)
           
 
Method Summary
 Writer append(char c)
           
 Writer append(CharSequence charSequence)
           
 Writer append(CharSequence charSequence, int i, int i1)
           
 void close()
           
 void flush()
           
 String toString()
           
 void write(char[] chars)
           
 void write(char[] chars, int i, int i1)
           
 void write(int i)
           
 void write(String s)
           
 void write(String s, int i, int i1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FastStringWriter

public FastStringWriter()

FastStringWriter

protected FastStringWriter(Object o)
Method Detail

write

public void write(int i)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(char[] chars)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(String s)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

write

public void write(String s,
                  int i,
                  int i1)
           throws IOException
Overrides:
write in class Writer
Throws:
IOException

append

public Writer append(CharSequence charSequence)
              throws IOException
Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
IOException

append

public Writer append(CharSequence charSequence,
                     int i,
                     int i1)
              throws IOException
Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
IOException

append

public Writer append(char c)
              throws IOException
Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
IOException

write

public void write(char[] chars,
                  int i,
                  int i1)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2005-2009 The Grails project