com.beanit.asn1bean.ber

## Class ReverseByteArrayOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - com.beanit.asn1bean.ber.ReverseByteArrayOutputStream

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

      public class ReverseByteArrayOutputStream
      extends java.io.OutputStream

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `byte[]` | `buffer`
    `int` | `index`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReverseByteArrayOutputStream(byte[] buffer)`
    `ReverseByteArrayOutputStream(byte[] buffer, int startingIndex)`
    `ReverseByteArrayOutputStream(byte[] buffer, int startingIndex, boolean automaticResize)`
    `ReverseByteArrayOutputStream(int bufferSize)` Creates a `ReverseByteArrayOutputStream` with a byte array of size `bufferSize` .
    `ReverseByteArrayOutputStream(int bufferSize, boolean automaticResize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getArray()` Returns a new array containing the subarray of the stream array that contains the coded content.
    `java.nio.ByteBuffer` | `getByteBuffer()`
    `void` | `reset()`
    `void` | `write(byte arg0)`
    `void` | `write(byte[] byteArray)`
    `void` | `write(int arg0)`

    - ### Methods inherited from class java.io.OutputStream

      `close, flush, write`

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

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

- - ### Field Detail

    - #### buffer

          public byte[] buffer

    - #### index

          public int index

  - ### Constructor Detail

    - #### ReverseByteArrayOutputStream

          public ReverseByteArrayOutputStream(int bufferSize)

      Creates a `ReverseByteArrayOutputStream` with a byte array of size `bufferSize` . The buffer will not be resized automatically. Use `ReverseByteArrayOutputStream(int, boolean)` instead if you want the buffer to be dynamically resized.
      Parameters:
        `bufferSize` - the size of the underlying buffer

    - #### ReverseByteArrayOutputStream

          public ReverseByteArrayOutputStream(int bufferSize,
                                              boolean automaticResize)

    - #### ReverseByteArrayOutputStream

          public ReverseByteArrayOutputStream(byte[] buffer)

    - #### ReverseByteArrayOutputStream

          public ReverseByteArrayOutputStream(byte[] buffer,
                                              int startingIndex)

    - #### ReverseByteArrayOutputStream

          public ReverseByteArrayOutputStream(byte[] buffer,
                                              int startingIndex,
                                              boolean automaticResize)

  - ### Method Detail

    - #### write

          public void write(int arg0)

      Specified by:
        `write` in class `java.io.OutputStream`

    - #### write

          public void write(byte arg0)

    - #### write

          public void write(byte[] byteArray)

      Overrides:
        `write` in class `java.io.OutputStream`

    - #### getArray

          public byte[] getArray()

      Returns a new array containing the subarray of the stream array that contains the coded content.
      Returns:
        a new array containing the subarray of the stream array

    - #### getByteBuffer

          public java.nio.ByteBuffer getByteBuffer()

    - #### reset

          public void reset()