Class AvailableByteArrayBody

java.lang.Object
io.micronaut.servlet.http.body.AvailableByteArrayBody
All Implemented Interfaces:
io.micronaut.http.body.AvailableByteBody, io.micronaut.http.body.ByteBody, io.micronaut.http.body.CloseableAvailableByteBody, io.micronaut.http.body.CloseableByteBody, Closeable, AutoCloseable

@Internal public final class AvailableByteArrayBody extends Object implements io.micronaut.http.body.CloseableAvailableByteBody
AvailableByteBody implementation based on a byte array.

Note: While internal, this is also used from the Azure, AWS and GCP modules.

Since:
4.9.0
Author:
Jonas Konrad
  • Nested Class Summary

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

    io.micronaut.http.body.ByteBody.BodyDiscardedException, io.micronaut.http.body.ByteBody.SplitBackpressureMode
  • Constructor Summary

    Constructors
    Constructor
    Description
    AvailableByteArrayBody(byte[] array)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    CompletableFuture<? extends io.micronaut.http.body.CloseableAvailableByteBody>
     
    void
     
    long
     
    @NonNull io.micronaut.http.body.CloseableAvailableByteBody
     
    byte @NonNull []
     
    @NonNull io.micronaut.core.io.buffer.ByteBuffer<?>
     
    @NonNull InputStream
     

    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.AvailableByteBody

    expectedLength, split, toByteArrayPublisher, toByteBufferPublisher, toString

    Methods inherited from interface io.micronaut.http.body.CloseableAvailableByteBody

    allowDiscard

    Methods inherited from interface io.micronaut.http.body.CloseableByteBody

    allowDiscard
  • Constructor Details

    • AvailableByteArrayBody

      public AvailableByteArrayBody(byte[] array)
  • Method Details

    • split

      @NonNull public @NonNull io.micronaut.http.body.CloseableAvailableByteBody split()
      Specified by:
      split in interface io.micronaut.http.body.AvailableByteBody
      Specified by:
      split in interface io.micronaut.http.body.ByteBody
    • toInputStream

      @NonNull public @NonNull InputStream toInputStream()
      Specified by:
      toInputStream in interface io.micronaut.http.body.ByteBody
    • buffer

      public CompletableFuture<? extends io.micronaut.http.body.CloseableAvailableByteBody> buffer()
      Specified by:
      buffer in interface io.micronaut.http.body.ByteBody
    • length

      public long length()
      Specified by:
      length in interface io.micronaut.http.body.AvailableByteBody
    • toByteArray

      public byte @NonNull [] toByteArray()
      Specified by:
      toByteArray in interface io.micronaut.http.body.AvailableByteBody
    • toByteBuffer

      @NonNull public @NonNull io.micronaut.core.io.buffer.ByteBuffer<?> toByteBuffer()
      Specified by:
      toByteBuffer in interface io.micronaut.http.body.AvailableByteBody
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface io.micronaut.http.body.CloseableByteBody