public class StringWriter extends StreamImpl
_nullPath, _path
Constructor and Description |
---|
StringWriter() |
StringWriter(CharBuffer cb) |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
Returns true since StringWriter is for writing.
|
java.lang.String |
getString() |
WriteStream |
openWrite()
Opens a write stream using this StringWriter as the resulting string
|
void |
write(byte[] buf,
int offset,
int length,
boolean isEnd)
Writes a utf-8 encoded buffer to the underlying string.
|
canRead, clearWrite, close, closeWrite, flush, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, read, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, writeMmap, writeSendfile
public StringWriter()
public StringWriter(CharBuffer cb)
public WriteStream openWrite()
public java.lang.String getString()
public boolean canWrite()
canWrite
in class StreamImpl
public void write(byte[] buf, int offset, int length, boolean isEnd) throws java.io.IOException
write
in class StreamImpl
buf
- byte buffer containing the bytesoffset
- offset where to start writinglength
- number of bytes to writeisEnd
- true when the write is flushing a close.java.io.IOException