public class ByteArrayOutputStream
extends OutputStream
Copy the code
This class implements an output stream in which data is written to a byte array. The buffer grows automatically as data is written.
You can use toByteArray() and toString() to get data.
Disabling ByteArrayOutputStream is invalid. Methods in this class can still be called after closing the flow without generating any IOExceptions.