DirectByteArrayOutputStream (Apache Tomcat 7.0.108 API Documentation)

org.apache.catalina.tribes.io

## Class DirectByteArrayOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.catalina.tribes.io.DirectByteArrayOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class DirectByteArrayOutputStream
      extends OutputStream

  Byte array output stream that exposes the byte array directly
  Version:
    1.0
  Author:
    not attributable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectByteArrayOutputStream(int size)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getArray()`
    `byte[]` | `getArrayDirect()`
    `int` | `size()`
    `void` | `write(int b)` Writes the specified byte to this output stream.

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

      `close, flush, write, write`

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

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

- - ### Constructor Detail

    - #### DirectByteArrayOutputStream

          public DirectByteArrayOutputStream(int size)

  - ### Method Detail

    - #### write

          public void write(int b)
                     throws IOException

      Writes the specified byte to this output stream.
      Specified by:
        `write` in class `OutputStream`
      Parameters:
        `b` - the `byte`.
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed. TODO Implement this java.io.OutputStream method

    - #### size

          public int size()

    - #### getArrayDirect

          public byte[] getArrayDirect()

    - #### getArray

          public byte[] getArray()

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.