- java.lang.Object
-
- de.haumacher.msgbuf.io.StringW
-
-
Constructor Summary
Constructors Constructor Description StringW()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the stream, flushing it first.voidflush()Flushes the stream.StringtoString()voidwrite(char ch)Writes a single character.voidwrite(String str)Writes a string.voidwrite(String str, int start, int length)Writes a portion of a string.
-
-
-
Method Detail
-
write
public void write(char ch)
Description copied from interface:WriterWrites a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.Subclasses that intend to support efficient single-character output should override this method.
-
write
public void write(String str, int start, int length) throws IOException
Description copied from interface:WriterWrites a portion of a string.- Specified by:
writein interfaceWriter- Parameters:
str- A Stringstart- Offset from which to start writing characterslength- Number of characters to write- Throws:
IOException- If an I/O error occurs
-
flush
public void flush()
Description copied from interface:WriterFlushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.
-
close
public void close()
Description copied from interface:WriterCloses the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.
-
-