|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.threerings.io.ByteBufferOutputStream
public class ByteBufferOutputStream
Stores output in an ByteBuffer that grows automatically to accommodate the data.
| Field Summary | |
|---|---|
protected ByteBuffer |
_buffer
The buffer in which we store our frame data. |
protected static int |
INITIAL_BUFFER_SIZE
The default initial size of the internal buffer. |
| Constructor Summary | |
|---|---|
ByteBufferOutputStream()
Creates a new byte buffer output stream. |
|
| Method Summary | |
|---|---|
protected void |
expand(int needed)
Expands our buffer to accomodate the specified capacity. |
ByteBuffer |
flip()
Flips and returns the buffer. |
ByteBuffer |
getBuffer()
Returns a reference to the underlying buffer. |
void |
reset()
Resets our internal buffer. |
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.OutputStream |
|---|
close, flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ByteBuffer _buffer
protected static final int INITIAL_BUFFER_SIZE
| Constructor Detail |
|---|
public ByteBufferOutputStream()
| Method Detail |
|---|
public ByteBuffer getBuffer()
public ByteBuffer flip()
reset() to reset the buffer before
writing again.
public void reset()
public void write(int b)
write in class OutputStream
public void write(byte[] b,
int off,
int len)
write in class OutputStreamprotected final void expand(int needed)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||