com.netflix.astyanax.serializers
Class ByteBufferOutputStream
java.lang.Object
java.io.OutputStream
com.netflix.astyanax.serializers.ByteBufferOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class ByteBufferOutputStream
- extends OutputStream
Utility to collect data written to an OutputStream
in
ByteBuffer
s.
Originally from org.apache.avro.util.ByteBufferOutputStream, moved into
Hector and added getByteBuffer to return single ByteBuffer from contents.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
ByteBufferOutputStream
public ByteBufferOutputStream()
getBufferList
public List<ByteBuffer> getBufferList()
- Returns all data written and resets the stream to be empty.
getByteBuffer
public ByteBuffer getByteBuffer()
prepend
public void prepend(List<ByteBuffer> lists)
- Prepend a list of ByteBuffers to this stream.
append
public void append(List<ByteBuffer> lists)
- Append a list of ByteBuffers to this stream.
reset
public void reset()
write
public void write(int b)
- Specified by:
write
in class OutputStream
writeShort
public void writeShort(short value)
writeChar
public void writeChar(char value)
writeInt
public void writeInt(int value)
writeFloat
public void writeFloat(float value)
writeLong
public void writeLong(long value)
writeDouble
public void writeDouble(double value)
write
public void write(byte[] b,
int off,
int len)
- Overrides:
write
in class OutputStream
write
public void write(ByteBuffer buffer)
- Add a buffer to the output without copying, if possible.
Copyright © 2012. All Rights Reserved.