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 Writer
IOException
Writer.write(int)
public void write(char[] cbuf) throws IOException
write
in class Writer
IOException
Writer.write(char[])
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
Writer.write(char[], int, int)
public int getLength()
public CharBuffer getFirstBuffer()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public char[] toCharArray()
IOException
public void writeTo(Writer writer) throws IOException
writer
- IOException
public void printTo(javax.servlet.ServletOutputStream outputStream) throws IOException
IOException
public FastBufferOutputStream convertToOutputStream(String encoding) throws UnsupportedEncodingException
encoding
- UnsupportedEncodingException
public FastBufferOutputStream convertToOutputStream()
public void reset()
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.