public class FastBufferOutputStream extends OutputStream
| Constructor and Description |
|---|
FastBufferOutputStream()
Creates instance of default initial capacity.
|
FastBufferOutputStream(ByteBuffer firstBuffer)
Creates instance for an already existing chain of byte arrays.
|
FastBufferOutputStream(int initialSize)
Creates instance with required initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
FastBufferWriter |
convertToWriter()
Returns instance of FastBufferWriter containing all data written to this output stream.
|
FastBufferWriter |
convertToWriter(String encoding)
Returns instance of FastBufferWriter containing all data written to this output stream.
|
ByteBuffer |
getFirstBuffer()
Returns the first link of the chain of byte arrays.
|
int |
getLength()
Returns the total number of written bytes.
|
void |
reset()
Resets stream to empty state
|
byte[] |
toByteArray() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int c) |
void |
writeTo(OutputStream out)
Writes all data written up to the moment to out.
|
void |
writeTo(Writer out,
String encoding)
Writes all data written up to the moment to out.
|
close, flushpublic FastBufferOutputStream()
public FastBufferOutputStream(ByteBuffer firstBuffer)
firstBuffer - public FastBufferOutputStream(int initialSize)
initialSize - public void write(int c)
throws IOException
write in class OutputStreamIOExceptionjava.io.OutputStream.write(int c)public void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionjava.io.OutputStream.write(byte b[])public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionjava.io.OutputStream.write(byte[] b, int off, int len)public int getLength()
public ByteBuffer getFirstBuffer()
public byte[] toByteArray()
public void writeTo(OutputStream out) throws IOException
out - IOExceptionpublic void writeTo(Writer out, String encoding) throws IOException
out - IOExceptionpublic FastBufferWriter convertToWriter(String encoding) throws UnsupportedEncodingException
encoding - UnsupportedEncodingExceptionpublic FastBufferWriter convertToWriter()
public void reset()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.