org.apache.cassandra.io.util

## Class DataOutputBuffer

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.cassandra.io.util.DataOutputStreamPlus
    - - org.apache.cassandra.io.util.BufferedDataOutputStreamPlus
      - - org.apache.cassandra.io.util.DataOutputBuffer

- All Implemented Interfaces:
    java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable, DataOutputPlus
  Direct Known Subclasses:
    DataOutputBufferFixed, SafeMemoryWriter

      public class DataOutputBuffer
      extends BufferedDataOutputStreamPlus

  An implementation of the DataOutputStream interface using a FastByteArrayOutputStream and exposing its buffer so copies can be avoided. This class is completely thread unsafe.

- - ### Field Summary

    - ### Fields inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus

      `channel`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `DataOutputBuffer()`
    `protected` | `DataOutputBuffer(java.nio.ByteBuffer buffer)`
    `` | `DataOutputBuffer(int size)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `buffer()`
    `void` | `close()`
    `protected void` | `doFlush(int count)`
    `void` | `flush()`
    `byte[]` | `getData()`
    `int` | `getLength()`
    `protected java.nio.channels.WritableByteChannel` | `newDefaultChannel()`
    `protected void` | `reallocate(long count)`
    `byte[]` | `toByteArray()`

    - ### Methods inherited from class org.apache.cassandra.io.util.BufferedDataOutputStreamPlus

      `applyToChannel, ensureRemaining, order, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF`

    - ### Methods inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus

      `retrieveTemporaryBuffer`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DataOutputBuffer

          public DataOutputBuffer()

    - #### DataOutputBuffer

          public DataOutputBuffer(int size)

    - #### DataOutputBuffer

          protected DataOutputBuffer(java.nio.ByteBuffer buffer)

  - ### Method Detail

    - #### flush

          public void flush()
                     throws java.io.IOException

      Specified by:
        `flush` in interface `java.io.Flushable`
      Overrides:
        `flush` in class `BufferedDataOutputStreamPlus`
      Throws:
        `java.io.IOException`

    - #### doFlush

          protected void doFlush(int count)
                          throws java.io.IOException

      Overrides:
        `doFlush` in class `BufferedDataOutputStreamPlus`
      Throws:
        `java.io.IOException`

    - #### reallocate

          protected void reallocate(long count)

    - #### newDefaultChannel

          protected java.nio.channels.WritableByteChannel newDefaultChannel()

      Overrides:
        `newDefaultChannel` in class `DataOutputStreamPlus`

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `BufferedDataOutputStreamPlus`

    - #### buffer

          public java.nio.ByteBuffer buffer()

    - #### getData

          public byte[] getData()

    - #### getLength

          public int getLength()

    - #### toByteArray

          public byte[] toByteArray()

Copyright © 2018 The Apache Software Foundation