Class StreamingNettyByteBody.SharedBuffer

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

@Internal public static final class StreamingNettyByteBody.SharedBuffer extends io.micronaut.http.body.stream.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.

  • Nested Class Summary

    Nested classes/interfaces inherited from class io.micronaut.http.body.stream.BaseSharedBuffer

    io.micronaut.http.body.stream.BaseSharedBuffer.AsFlux, io.micronaut.http.body.stream.BaseSharedBuffer.IncorrectContentLengthException

    Nested classes/interfaces inherited from interface io.micronaut.http.body.stream.BufferConsumer

    io.micronaut.http.body.stream.BufferConsumer.Upstream
  • Constructor Summary

    Constructors
    Constructor
    Description
    SharedBuffer(io.netty.channel.EventLoop loop, NettyByteBodyFactory byteBodyFactory, io.micronaut.http.body.stream.BodySizeLimits limits, io.micronaut.http.body.stream.BufferConsumer.Upstream rootUpstream)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(io.micronaut.core.io.buffer.ReadBuffer rb)
     
    protected void
    afterSubscribe(boolean last)
     
    io.netty.channel.EventLoop
     
    protected void
     
    void
    setExpectedLengthFrom(io.netty.handler.codec.http.HttpHeaders headers)
     

    Methods inherited from class io.micronaut.http.body.stream.BaseSharedBuffer

    complete, error, getExpectedLength, getLimits, getRootUpstream, logClaim, setExpectedLength, setExpectedLengthFrom, subscribe0, subscribeFull0

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.http.body.stream.BufferConsumer

    discard
  • Constructor Details

    • SharedBuffer

      public SharedBuffer(io.netty.channel.EventLoop loop, NettyByteBodyFactory byteBodyFactory, io.micronaut.http.body.stream.BodySizeLimits limits, io.micronaut.http.body.stream.BufferConsumer.Upstream rootUpstream)
  • Method Details

    • eventLoop

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

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

      protected void reserve0()
      Overrides:
      reserve0 in class io.micronaut.http.body.stream.BaseSharedBuffer
    • afterSubscribe

      protected void afterSubscribe(boolean last)
      Overrides:
      afterSubscribe in class io.micronaut.http.body.stream.BaseSharedBuffer
    • add

      public void add(io.micronaut.core.io.buffer.ReadBuffer rb)
      Specified by:
      add in interface io.micronaut.http.body.stream.BufferConsumer
      Overrides:
      add in class io.micronaut.http.body.stream.BaseSharedBuffer