## org.apache.cassandra.io.util
Class OutputBuffer

    java.lang.Object
      java.io.OutputStream
          org.apache.cassandra.io.util.FastByteArrayOutputStream
              org.apache.cassandra.io.util.OutputBuffer

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable

    public final class OutputBuffer

extends FastByteArrayOutputStream

Extends FastByteArrayOutputStream to minimize copies.

Field Summary

Fields inherited from class org.apache.cassandra.io.util.FastByteArrayOutputStream
`buf, count`

Constructor Summary
`OutputBuffer()`
`OutputBuffer(int size)`

Method Summary
`byte[]` `asByteArray()`
`byte[]` `getData()`
`int` `getLength()`
`void` `write(java.io.DataInput in, int len)`

Methods inherited from class org.apache.cassandra.io.util.FastByteArrayOutputStream
`close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo`

Methods inherited from class java.io.OutputStream
`flush, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### OutputBuffer

    public OutputBuffer()

### OutputBuffer

    public OutputBuffer(int size)

Method Detail

### getData

    public byte[] getData()

### getLength

    public int getLength()

### write

    public void write(java.io.DataInput in,
                      int len)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### asByteArray

    public byte[] asByteArray()

  Returns:
    The valid contents of the buffer, possibly by copying: only safe for one-time-use buffers.

Copyright © 2012 The Apache Software Foundation