org.codehaus.groovy.runtime
Class StringBufferWriter

This class codes around a silly limiation of StringWriter which doesn't allow a StringBuffer to be passed in as a constructor for some bizzare reason. So we replicate the behaviour of StringWriter here but allow a StringBuffer to be passed in.

author:
James Strachan
version:
$Revision: 6778 $

Field Summary
 StringBuffer buffer
           
 
Constructor Summary
StringBufferWriter(StringBuffer buffer)
            Create a new string writer which will append the text to the given StringBuffer
 
Method Summary
void close()
           Closing a StringWriter has no effect.
void flush()
           Flush the stream.
String toString()
           Return the buffer's current value as a string.
void write(int c)
           Write a single character.
void write(def text, int offset, int length)
           Write a portion of an array of characters.
void write(String text)
           Write a string.
void write(String text, int offset, int length)
           Write a portion of a string.
 

Constructor Detail

StringBufferWriter

public StringBufferWriter(StringBuffer buffer)
Create a new string writer which will append the text to the given StringBuffer


Method Detail

close

public void close()
Closing a StringWriter has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.


flush

public void flush()
Flush the stream.


toString

public String toString()
Return the buffer's current value as a string.


write

public void write(int c)
Write a single character.


write

public void write(def text, int offset, int length)
Write a portion of an array of characters.
param:
text Array of characters
param:
offset Offset from which to start writing characters
param:
length Number of characters to write


write

public void write(String text)
Write a string.


write

public void write(String text, int offset, int length)
Write a portion of a string.
param:
text the text to be written
param:
offset offset from which to start writing characters
param:
length Number of characters to write