|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
org.mmbase.util.StringBufferWriter
public class StringBufferWriter
Oddly enough, Java does not provide this itself. Code is nearly identical to java.io.StringWriter.
StringWriter| Field Summary | |
|---|---|
protected StringBuffer |
buffer
|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
StringBufferWriter(StringBuffer buffer)
Create a new StringBufferWriter |
|
| Method Summary | |
|---|---|
void |
close()
Closing a StringBufferWriter has no effect. |
void |
flush()
Flush the stream. |
StringBuffer |
getBuffer()
Return the string buffer itself. |
String |
toString()
Return the buffer's current value as a string. |
void |
write(char[] charArray,
int offset,
int length)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(String str)
Write a string. |
void |
write(String str,
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 |
| Field Detail |
|---|
protected StringBuffer buffer
| Constructor Detail |
|---|
public StringBufferWriter(StringBuffer buffer)
buffer - The StringBuffer to use
NullPointerException - if buffer is null.| Method Detail |
|---|
public void write(int c)
write in class Writer
public void write(char[] charArray,
int offset,
int length)
write in class WritercharArray - Array of charactersoffset - Offset from which to start writing characterslength - Number of characters to writepublic void write(String str)
write in class Writer
public void write(String str,
int offset,
int length)
write in class Writerstr - String to be writtenoffset - Offset from which to start writing characterslength - Number of characters to writepublic String toString()
toString in class Objectpublic StringBuffer getBuffer()
public void flush()
flush in interface Flushableflush in class Writer
public void close()
throws IOException
close in interface Closeableclose in class WriterIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||