org.apache.cassandra.io.util

## Class DataOutputBufferFixed

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

- All Implemented Interfaces:
    java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable, DataOutputPlus

      public class DataOutputBufferFixed
      extends DataOutputBuffer

  An implementation of the DataOutputStream interface using a FastByteArrayOutputStream and exposing its buffer so copies can be avoided. This version does not expand if it runs out of capacity and throws BufferOverflowException instead. This class is completely thread unsafe.

- - ### Field Summary

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

      `scratchBuffer`

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

      `buffer, strictFlushing`

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

      `channel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataOutputBufferFixed()`
    `DataOutputBufferFixed(java.nio.ByteBuffer buffer)`
    `DataOutputBufferFixed(int size)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `protected void` | `doFlush(int count)`
    `protected void` | `reallocate(long newSize)`

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

      `asNewBuffer, buffer, close, flush, getData, getLength, hasPosition, newDefaultChannel, position, toByteArray`

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

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

    - ### 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

    - #### DataOutputBufferFixed

          public DataOutputBufferFixed()

    - #### DataOutputBufferFixed

          public DataOutputBufferFixed(int size)

    - #### DataOutputBufferFixed

          public DataOutputBufferFixed(java.nio.ByteBuffer buffer)

  - ### Method Detail

    - #### doFlush

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

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

    - #### reallocate

          protected void reallocate(long newSize)

      Overrides:
        `reallocate` in class `DataOutputBuffer`

    - #### clear

          public void clear()

      Overrides:
        `clear` in class `DataOutputBuffer`

Copyright © 2018 The Apache Software Foundation