Class StreamingNettyByteBody.SharedBuffer

java.lang.Object
io.micronaut.http.server.netty.body.StreamingNettyByteBody.SharedBuffer
All Implemented Interfaces:
BufferConsumer
Enclosing class:
StreamingNettyByteBody

public static final class StreamingNettyByteBody.SharedBuffer extends Object implements BufferConsumer
This class buffers input data and distributes it to multiple StreamingNettyByteBody instances.

Thread safety: The BufferConsumer methods must only be called from one thread, the eventLoop thread. The other methods (subscribe, reserve) can be called from any thread.

  • Constructor Details

  • Method Details

    • setExpectedLengthFrom

      public void setExpectedLengthFrom(io.netty.handler.codec.http.HttpHeaders headers)
    • setExpectedLength

      public void setExpectedLength(long length)
    • add

      public void add(io.netty.buffer.ByteBuf buf)
      Description copied from interface: BufferConsumer
      Consume a buffer. Release ownership is transferred to this consumer.
      Specified by:
      add in interface BufferConsumer
      Parameters:
      buf - The buffer to consume
    • complete

      public void complete()
      Description copied from interface: BufferConsumer
      Signal normal completion of the stream.
      Specified by:
      complete in interface BufferConsumer
    • error

      public void error(Throwable e)
      Description copied from interface: BufferConsumer
      Signal an upstream error.
      Specified by:
      error in interface BufferConsumer
      Parameters:
      e - The error