Class InitiallyReusableByteArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- com.feedzai.commons.sql.abstraction.util.InitiallyReusableByteArrayOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public final class InitiallyReusableByteArrayOutputStream extends ByteArrayOutputStream
A take onByteArrayOutputStreamthat takes a provided byte array as its initial buffer. This is useful for situations where there is only one thread at a time creating these objects and allocating the initial array is expensive.- Since:
- 2.0.0
- Author:
- Diogo Ferreira (diogo.ferreira@feedzai.com)
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
Constructor Summary
Constructors Constructor Description InitiallyReusableByteArrayOutputStream(byte[] initialArray)Builds an instance with an initial buffer.
-
Method Summary
-
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-