Class ByteBufferOutputStream2

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    @Deprecated(since="2021-05-27")
    public class ByteBufferOutputStream2
    extends java.io.OutputStream
    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.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void close()
      Deprecated.
       
      ByteBufferPool getByteBufferPool()
      Deprecated.
       
      int size()
      Deprecated.
       
      java.nio.ByteBuffer takeByteBuffer()
      Deprecated.
      Take the combined buffer containing all content written to the OutputStream.
      byte[] toByteArray()
      Deprecated.
       
      java.nio.ByteBuffer toByteBuffer()
      Deprecated.
      Take the combined buffer containing all content written to the OutputStream.
      java.lang.String toString()
      Deprecated.
       
      void write​(byte[] b, int off, int len)
      Deprecated.
       
      void write​(int b)
      Deprecated.
       
      void write​(java.nio.ByteBuffer buffer)
      Deprecated.
       
      void writeTo​(java.io.OutputStream out)
      Deprecated.
       
      void writeTo​(java.nio.ByteBuffer buffer)
      Deprecated.
       
      • Methods inherited from class java.io.OutputStream

        flush, nullOutputStream, write
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ByteBufferOutputStream2

        public ByteBufferOutputStream2()
        Deprecated.
      • ByteBufferOutputStream2

        public ByteBufferOutputStream2​(ByteBufferPool bufferPool,
                                       boolean direct)
        Deprecated.
    • Method Detail

      • getByteBufferPool

        public ByteBufferPool getByteBufferPool()
        Deprecated.
      • takeByteBuffer

        public java.nio.ByteBuffer takeByteBuffer()
        Deprecated.
        Take the combined buffer containing all content written to the OutputStream. The caller is responsible for releasing this ByteBuffer back into the ByteBufferPool.
        Returns:
        a buffer containing all content written to the OutputStream.
      • toByteBuffer

        public java.nio.ByteBuffer 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 the ByteBufferPool 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

        public void write​(int b)
        Deprecated.
        Specified by:
        write in class java.io.OutputStream
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Deprecated.
        Overrides:
        write in class java.io.OutputStream
      • write

        public void write​(java.nio.ByteBuffer buffer)
        Deprecated.
      • writeTo

        public void writeTo​(java.nio.ByteBuffer buffer)
        Deprecated.
      • writeTo

        public void writeTo​(java.io.OutputStream out)
                     throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • close

        public void close()
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object