public class FastBufferWriter extends Writer
| Constructor and Description |
|---|
FastBufferWriter()
Creates instance of default initial capacity.
|
FastBufferWriter(CharBuffer firstBuffer)
Creates instance for an already existing chain of char arrays.
|
FastBufferWriter(int initialSize)
Creates instance with required initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
FastBufferOutputStream |
convertToOutputStream()
Returns instance of FastBufferOutputStream containing all data written to this writer.
|
FastBufferOutputStream |
convertToOutputStream(String encoding)
Returns instance of FastBufferOutputStream containing all data written to this writer.
|
void |
flush() |
CharBuffer |
getFirstBuffer()
Returns the first link of the chain of char arrays.
|
int |
getLength()
Returns the total number of written chars.
|
void |
printTo(javax.servlet.ServletOutputStream outputStream) |
void |
reset()
Resets writer to empty state
|
char[] |
toCharArray()
Writes all data written up to the moment to string buffer.
|
void |
write(char[] cbuf) |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
writeTo(Writer writer)
Writes all data written up to the moment to out.
|
public FastBufferWriter()
public FastBufferWriter(CharBuffer firstBuffer)
firstBuffer - public FastBufferWriter(int initialSize)
initialSize - public void write(int c)
throws IOException
write in class WriterIOExceptionjava.io.Writer.write(int c)public void write(char[] cbuf)
throws IOException
write in class WriterIOExceptionjava.io.Writer.write(char cbuf[])public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionjava.io.Writer.write(char cbuf[], int off, int len)public int getLength()
public CharBuffer getFirstBuffer()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic char[] toCharArray()
out - IOExceptionpublic void writeTo(Writer writer) throws IOException
out - IOExceptionpublic void printTo(javax.servlet.ServletOutputStream outputStream)
throws IOException
IOExceptionpublic FastBufferOutputStream convertToOutputStream(String encoding) throws UnsupportedEncodingException
encoding - UnsupportedEncodingExceptionpublic FastBufferOutputStream convertToOutputStream()
public void reset()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.