Java Code:
1 2 3 | . |
The ByteArrayOutputStream class stream creates a buffer in memory and all the data sent to the stream is stored in the buffer.
ByteArrayOutputStream() – constructor creates a ByteArrayOutputStream having buffer of 32 byte.
ByteArrayOutputStream(int a) – constructor creates a ByteArrayOutputStream having buffer of the given size.