Class StreamingByteBody

java.lang.Object
io.micronaut.http.server.netty.body.StreamingByteBody
All Implemented Interfaces:
ByteBody, HttpBody

@Internal public final class StreamingByteBody extends Object implements ByteBody
ByteBody implementation that wraps a StreamedHttpRequest.
Since:
4.0.0
Author:
Jonas Konrad
  • Method Details

    • processMulti

      public MultiObjectBody processMulti(FormDataHttpContentProcessor processor)
      Description copied from interface: ByteBody
      Process this body using the given processor.
      Only used for form processing now.
      Specified by:
      processMulti in interface ByteBody
      Parameters:
      processor - The processor to apply
      Returns:
      The new processed body
    • rawContent

      public MultiObjectBody rawContent(HttpServerConfiguration configuration)
      Description copied from interface: ByteBody
      Transform this body to a MultiObjectBody containing ByteBufs with the raw body. There is a check against HttpServerConfiguration.getMaxRequestSize().
      Specified by:
      rawContent in interface ByteBody
      Parameters:
      configuration - The configuration for request size limits
      Returns:
      The body containing ByteBufs
    • buffer

      public ExecutionFlow<ImmediateByteBody> buffer(io.netty.buffer.ByteBufAllocator alloc)
      Description copied from interface: ByteBody
      Fully buffer this body.
      Specified by:
      buffer in interface ByteBody
      Parameters:
      alloc - The allocator for storage
      Returns:
      A flow that completes when all data has been read
    • claimForReuse

      public io.netty.handler.codec.http.HttpRequest claimForReuse(io.netty.handler.codec.http.HttpRequest request)
      Description copied from interface: ByteBody
      Claim this body and convert it back to a HttpRequest. This is used for proxying, where the request received by the server is reused by the client.
      Specified by:
      claimForReuse in interface ByteBody
      Parameters:
      request - The input request (headers and such)
      Returns:
      The request including the body, either a FullHttpRequest or a StreamedHttpRequest
    • release

      public final void release()
      Description copied from interface: HttpBody
      Release this body and any downstream representations.
      Specified by:
      release in interface HttpBody
    • next

      @Nullable public @Nullable HttpBody next()
      Description copied from interface: HttpBody
      Get the next representation this body was transformed into, if any.
      Specified by:
      next in interface HttpBody
      Returns:
      The next representation, or null if this body has not been transformed