Package org.eclipse.jetty.io
Class ByteBufferOutputStream2
java.lang.Object
java.io.OutputStream
org.eclipse.jetty.io.ByteBufferOutputStream2
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
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.-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ByteBufferOutputStream2(ByteBufferPool bufferPool, boolean direct) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.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 java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
ByteBufferOutputStream2
public ByteBufferOutputStream2()Deprecated. -
ByteBufferOutputStream2
Deprecated.
-
-
Method Details
-
getByteBufferPool
Deprecated. -
takeByteBuffer
Deprecated.Take the combined buffer containing all content written to the OutputStream. The caller is responsible for releasing thisByteBufferback into theByteBufferPool.- 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 back to theByteBufferPoolwhen 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
public void write(int b) Deprecated.- Specified by:
writein classOutputStream
-
write
public void write(byte[] b, int off, int len) Deprecated.- Overrides:
writein classOutputStream
-
write
Deprecated. -
writeTo
Deprecated. -
writeTo
Deprecated.- Throws:
IOException
-
close
public void close()Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
toString
Deprecated.
-