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 TypeMethodDescriptionvoid
close()
Deprecated.int
size()
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.void
write
(byte[] b, int off, int len) Deprecated.void
write
(int b) Deprecated.void
write
(ByteBuffer buffer) Deprecated.void
writeTo
(OutputStream out) Deprecated.void
writeTo
(ByteBuffer buffer) Deprecated.Methods inherited from class java.io.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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
-
toString
-
Content.Sink.asBuffered(Content.Sink, ByteBufferPool, boolean, int, int)