Package io.micronaut.servlet.http.body
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
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<? extends io.micronaut.http.body.CloseableAvailableByteBody>
buffer()
void
close()
long
length()
@NonNull io.micronaut.http.body.CloseableAvailableByteBody
split()
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 interfaceio.micronaut.http.body.AvailableByteBody
- Specified by:
split
in interfaceio.micronaut.http.body.ByteBody
-
toInputStream
- Specified by:
toInputStream
in interfaceio.micronaut.http.body.ByteBody
-
buffer
- Specified by:
buffer
in interfaceio.micronaut.http.body.ByteBody
-
length
public long length()- Specified by:
length
in interfaceio.micronaut.http.body.AvailableByteBody
-
toByteArray
public byte @NonNull [] toByteArray()- Specified by:
toByteArray
in interfaceio.micronaut.http.body.AvailableByteBody
-
toByteBuffer
@NonNull public @NonNull io.micronaut.core.io.buffer.ByteBuffer<?> toByteBuffer()- Specified by:
toByteBuffer
in interfaceio.micronaut.http.body.AvailableByteBody
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceio.micronaut.http.body.CloseableByteBody
-