public class

ByteBufferOutputStream

extends OutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ com.netflix.astyanax.serializers.ByteBufferOutputStream

Class Overview

Utility to collect data written to an OutputStream in ByteBuffers. Originally from org.apache.avro.util.ByteBufferOutputStream, moved into Hector and added getByteBuffer to return single ByteBuffer from contents.

Summary

Constants
int BUFFER_SIZE
Public Constructors
ByteBufferOutputStream()
Public Methods
void append(List<ByteBuffer> lists)
Append a list of ByteBuffers to this stream.
List<ByteBuffer> getBufferList()
Returns all data written and resets the stream to be empty.
ByteBuffer getByteBuffer()
void prepend(List<ByteBuffer> lists)
Prepend a list of ByteBuffers to this stream.
void reset()
void write(int b)
void write(byte[] b, int off, int len)
void write(ByteBuffer buffer)
Add a buffer to the output without copying, if possible.
void writeChar(char value)
void writeDouble(double value)
void writeFloat(float value)
void writeInt(int value)
void writeLong(long value)
void writeShort(short value)
[Expand]
Inherited Methods
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface java.lang.AutoCloseable

Constants

public static final int BUFFER_SIZE

Constant Value: 8192 (0x00002000)

Public Constructors

public ByteBufferOutputStream ()

Public Methods

public void append (List<ByteBuffer> lists)

Append a list of ByteBuffers to this stream.

public List<ByteBuffer> getBufferList ()

Returns all data written and resets the stream to be empty.

public ByteBuffer getByteBuffer ()

public void prepend (List<ByteBuffer> lists)

Prepend a list of ByteBuffers to this stream.

public void reset ()

public void write (int b)

public void write (byte[] b, int off, int len)

public void write (ByteBuffer buffer)

Add a buffer to the output without copying, if possible.

public void writeChar (char value)

public void writeDouble (double value)

public void writeFloat (float value)

public void writeInt (int value)

public void writeLong (long value)

public void writeShort (short value)