Class ByteBufferOutputStream2
java.lang.Object
java.io.OutputStream
org.eclipse.jetty.io.ByteBufferOutputStream2
- All Implemented Interfaces:
 Closeable, Flushable, AutoCloseable
Deprecated.
This class implements an output stream in which the data is buffered.
Designed to mimic ByteArrayOutputStream but with better memory usage, and less copying.
- 
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ByteBufferOutputStream2(ByteBufferPool bufferPool, boolean direct) Deprecated. - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.intsize()Deprecated.Deprecated.Take the combined buffer containing all content written to the OutputStream.byte[]Deprecated.Deprecated.Take the combined buffer containing all content written to the OutputStream.toString()Deprecated.voidwrite(byte[] b, int off, int len) Deprecated.voidwrite(int b) Deprecated.voidwrite(ByteBuffer buffer) Deprecated.voidwriteTo(OutputStream out) Deprecated.voidwriteTo(ByteBuffer buffer) Deprecated.Methods inherited from class OutputStream
flush, nullOutputStream, write 
- 
Constructor Details
- 
ByteBufferOutputStream2
public ByteBufferOutputStream2()Deprecated. - 
ByteBufferOutputStream2
Deprecated. 
 - 
 - 
Method Details
- 
takeByteBuffer
Deprecated.Take the combined buffer containing all content written to the OutputStream. The caller is responsible for releasing thisRetainableByteBuffer.- Returns:
 - a buffer containing all content written to the OutputStream.
 
 - 
toByteBuffer
Deprecated.Take the combined buffer containing all content written to the OutputStream. The returned buffer is still contained within the OutputStream and will be released when the OutputStream is closed.- Returns:
 - a buffer containing all content written to the OutputStream.
 
 - 
toByteArray
public byte[] toByteArray()Deprecated.- Returns:
 - a newly allocated byte array containing all content written into the OutputStream.
 
 - 
size
public int size()Deprecated. - 
write
 - 
write
 - 
write
Deprecated. - 
writeTo
Deprecated. - 
writeTo
 - 
close
public void close()Deprecated.- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Overrides:
 closein classOutputStream
 - 
toString
 
 - 
 
Content.Sink.asBuffered(Content.Sink, ByteBufferPool, boolean, int, int)