com.bigdata.io
Class ByteBufferOutputStream
java.lang.Object
java.io.OutputStream
com.bigdata.io.ByteBufferOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class ByteBufferOutputStream
- extends OutputStream
Writes bytes onto a ByteBuffer.
- Version:
- $Id: ByteBufferOutputStream.java 2265 2009-10-26 12:51:06Z thompsonbry $
- Author:
- Bryan Thompson
|
Method Summary |
ByteBuffer |
getByteBuffer()
|
void |
write(byte[] b,
int off,
int len)
Write an array of bytes on the buffer. |
void |
write(int b)
Write a byte on the buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buf
protected final ByteBuffer buf
ByteBufferOutputStream
public ByteBufferOutputStream(ByteBuffer buf)
getByteBuffer
public final ByteBuffer getByteBuffer()
write
public void write(int b)
throws IOException
- Write a byte on the buffer. The
Buffer.position() is advanced
as a side effect.
- Specified by:
write in class OutputStream
- Parameters:
b - A byte whose value is in [-128:127].
- Throws:
EOFException - if the buffer would overflow.
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Write an array of bytes on the buffer. The
Buffer.position()
is advanced as a side effect.
- Overrides:
write in class OutputStream
- Parameters:
b - the data.off - the start offset in the data.len - the number of bytes to write.
- Throws:
EOFException - if the buffer would overflow.
IOException
Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.