Package 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
  Description
  `DirectAccessByteArrayOutputStream(int initialSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `toByteArray()`

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

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

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

  `flush, nullOutputStream, write`

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

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

- ## Constructor Details

  - ### DirectAccessByteArrayOutputStream

    public DirectAccessByteArrayOutputStream(int initialSize)

- ## Method Details

  - ### toByteArray

    public byte[] toByteArray()
    Overrides:
      `toByteArray` in class `ByteArrayOutputStream`