|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
org.codehaus.groovy.runtime.StringBufferWriter
public 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.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
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(char[] text,
int offset,
int length)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(String text)
Write a string. |
void |
write(String text,
int offset,
int length)
Write a portion of a string. |
Methods inherited from class java.io.Writer |
---|
append, append, append, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringBufferWriter(StringBuffer buffer)
Method Detail |
---|
public void write(int c)
write
in class Writer
public void write(char[] text, int offset, int length)
write
in class Writer
text
- Array of charactersoffset
- Offset from which to start writing characterslength
- Number of characters to writepublic void write(String text)
write
in class Writer
public void write(String text, int offset, int length)
write
in class Writer
text
- the text to be writtenoffset
- offset from which to start writing characterslength
- Number of characters to writepublic String toString()
toString
in class Object
public void flush()
flush
in interface Flushable
flush
in class Writer
public void close() throws IOException
close
in interface Closeable
close
in class Writer
IOException
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |