org.apache.jmeter.protocol.http.util

## Class DirectAccessByteArrayOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.ByteArrayOutputStream
    - - org.apache.jmeter.protocol.http.util.DirectAccessByteArrayOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class DirectAccessByteArrayOutputStream
      extends ByteArrayOutputStream

  this is a non thread-safe specialization of java `ByteArrayOutputStream` it returns the internal buffer if its size matches the byte count
  Since:
    3.1

- - ### Field Summary

    - ### Fields inherited from class java.io.ByteArrayOutputStream

      `buf, count`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DirectAccessByteArrayOutputStream(int initialSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `toByteArray()`

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

      `close, reset, size, toString, toString, toString, write, write, writeTo`

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

      `flush, write`

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

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

- - ### Constructor Detail

    - #### DirectAccessByteArrayOutputStream

          public DirectAccessByteArrayOutputStream(int initialSize)

  - ### Method Detail

    - #### toByteArray

          public byte[] toByteArray()

      Overrides:
        `toByteArray` in class `ByteArrayOutputStream`

Copyright © 1998-2022 Apache Software Foundation. All Rights Reserved.