SafeMemoryWriter (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.io.util

## Class SafeMemoryWriter

- 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.SafeMemoryWriter

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

      public class SafeMemoryWriter
      extends DataOutputBuffer

- - ### Field Summary

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

      `channel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SafeMemoryWriter(long initialCapacity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `capacity()`
    `void` | `close()`
    `java.lang.Throwable` | `close(java.lang.Throwable accumulate)`
    `SafeMemory` | `currentBuffer()`
    `long` | `length()`
    `SafeMemoryWriter` | `order(java.nio.ByteOrder order)`
    `protected void` | `reallocate(long count)`
    `void` | `setCapacity(long newCapacity)`
    `long` | `validateReallocation(long newSize)`

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

      `buffer, doFlush, flush, getData, getLength, newDefaultChannel, toByteArray`

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

      `applyToChannel, ensureRemaining, 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

    - #### SafeMemoryWriter

          public SafeMemoryWriter(long initialCapacity)

  - ### Method Detail

    - #### currentBuffer

          public SafeMemory currentBuffer()

    - #### reallocate

          protected void reallocate(long count)

      Overrides:
        `reallocate` in class `DataOutputBuffer`

    - #### setCapacity

          public void setCapacity(long newCapacity)

    - #### close

          public void close()

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

    - #### close

          public java.lang.Throwable close(java.lang.Throwable accumulate)

    - #### length

          public long length()

    - #### capacity

          public long capacity()

    - #### order

          public SafeMemoryWriter order(java.nio.ByteOrder order)

      Overrides:
        `order` in class `BufferedDataOutputStreamPlus`

    - #### validateReallocation

          public long validateReallocation(long newSize)

Copyright © 2018 The Apache Software Foundation