|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer org.codehaus.groovy.runtime.StringBufferWriter
public class StringBufferWriter extends java.io.Writer
This class codes around a silly limiation of StringWriter which doesn't allow a StringBuffer to be passed in as a constructor for some bizarre reason. So we replicate the behaviour of StringWriter here but allow a StringBuffer to be passed in.
Constructor Summary | |
StringBufferWriter(java.lang.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. |
java.lang.String
|
toString()
Return the buffer's current value as a string. |
void
|
write(int c)
Write a single character. |
void
|
write(char[] text, int offset, int length)
Write a portion of an array of characters. |
void
|
write(java.lang.String text)
Write a string. |
void
|
write(java.lang.String text, int offset, int length)
Write a portion of a string. |
Methods inherited from class java.io.Writer | |
---|---|
java.io.Writer#append(java.lang.CharSequence), java.io.Writer#append(java.lang.CharSequence, int, int), java.io.Writer#append(char), java.io.Writer#append(char), java.io.Writer#append(java.lang.CharSequence, int, int), java.io.Writer#append(java.lang.CharSequence), java.io.Writer#write(int), java.io.Writer#write([C), java.io.Writer#write([C, int, int), java.io.Writer#write(java.lang.String), java.io.Writer#write(java.lang.String, int, int), java.io.Writer#flush(), java.io.Writer#close(), java.io.Writer#wait(long), java.io.Writer#wait(long, int), java.io.Writer#wait(), java.io.Writer#equals(java.lang.Object), java.io.Writer#toString(), java.io.Writer#hashCode(), java.io.Writer#getClass(), java.io.Writer#notify(), java.io.Writer#notifyAll() |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public StringBufferWriter(java.lang.StringBuffer buffer)
Method Detail |
---|
public void close()
public void flush()
public java.lang.String toString()
public void write(int c)
public void write(char[] text, int offset, int length)
text
- Array of charactersoffset
- Offset from which to start writing characterslength
- Number of characters to write
public void write(java.lang.String text)
public void write(java.lang.String text, int offset, int length)
text
- the text to be writtenoffset
- offset from which to start writing characterslength
- Number of characters to write
Groovy Documentation