Class ByteBufferOutputStream2

java.lang.Object
java.io.OutputStream
org.eclipse.jetty.io.ByteBufferOutputStream2
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class ByteBufferOutputStream2 extends OutputStream
This class implements an output stream in which the data is written into a list of ByteBuffer, the buffer list automatically grows as data is written to it, the buffers are taken from the supplied ByteBufferPool or freshly allocated if one is not supplied. Designed to mimic ByteArrayOutputStream but with better memory usage, and less copying.