Class StreamingNettyByteBody.SharedBuffer

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

@Internal public static final class StreamingNettyByteBody.SharedBuffer extends BaseSharedBuffer
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

    • eventLoop

      public io.netty.channel.EventLoop eventLoop()
    • setExpectedLengthFrom

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

      protected void reserve0()
      Description copied from class: BaseSharedBuffer
      Reserve a spot for a future subscribe operation.
      Not thread safe, caller must handle concurrency.
      Overrides:
      reserve0 in class BaseSharedBuffer
    • afterSubscribe

      protected void afterSubscribe(boolean last)
      Description copied from class: BaseSharedBuffer
      Called after a subscribe operation. Used for leak detection.
      Overrides:
      afterSubscribe in class BaseSharedBuffer
      Parameters:
      last - true iff this was the last reservation
    • add

      public void add(ReadBuffer rb)
      Description copied from class: BaseSharedBuffer
      Add a given buffer to this BaseSharedBuffer.
      Not thread safe, caller must handle concurrency.
      Specified by:
      add in interface BufferConsumer
      Overrides:
      add in class BaseSharedBuffer
      Parameters:
      rb - The buffer