Package io.micronaut.http.body
Class ReactiveByteBufferByteBody.SharedBuffer
java.lang.Object
io.micronaut.http.body.stream.BaseSharedBuffer
io.micronaut.http.body.ReactiveByteBufferByteBody.SharedBuffer
- All Implemented Interfaces:
BufferConsumer
- Enclosing class:
- ReactiveByteBufferByteBody
public static final class ReactiveByteBufferByteBody.SharedBuffer
extends BaseSharedBuffer
implements BufferConsumer
Simple implementation of
Buffering is done using a
BaseSharedBuffer
that consumes ByteBuffer
s.Buffering is done using a
ByteArrayOutputStream
. Concurrency control is done through
a non-reentrant lock based on AtomicReference
.-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.http.body.stream.BaseSharedBuffer
BaseSharedBuffer.AsFlux, BaseSharedBuffer.IncorrectContentLengthException
Nested classes/interfaces inherited from interface io.micronaut.http.body.stream.BufferConsumer
BufferConsumer.Upstream
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ReadBuffer rb) Add a given buffer to thisBaseSharedBuffer
.
Not thread safe, caller must handle concurrency.void
complete()
Implementation ofBufferConsumer.complete()
.
Not thread safe, caller must handle concurrency.void
Implementation ofBufferConsumer.error(Throwable)
.
Not thread safe, caller must handle concurrency.subscribeFull
(BufferConsumer.Upstream specificUpstream) Methods inherited from class io.micronaut.http.body.stream.BaseSharedBuffer
afterSubscribe, failClaim, getExpectedLength, getLimits, getRootUpstream, logClaim, reserve0, 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
-
Method Details
-
subscribeFull
-
add
Description copied from class:BaseSharedBuffer
Add a given buffer to thisBaseSharedBuffer
.
Not thread safe, caller must handle concurrency.- Specified by:
add
in interfaceBufferConsumer
- Overrides:
add
in classBaseSharedBuffer
- Parameters:
rb
- The buffer
-
error
Description copied from class:BaseSharedBuffer
Implementation ofBufferConsumer.error(Throwable)
.
Not thread safe, caller must handle concurrency.- Specified by:
error
in interfaceBufferConsumer
- Overrides:
error
in classBaseSharedBuffer
- Parameters:
e
- The error
-
complete
public void complete()Description copied from class:BaseSharedBuffer
Implementation ofBufferConsumer.complete()
.
Not thread safe, caller must handle concurrency.- Specified by:
complete
in interfaceBufferConsumer
- Overrides:
complete
in classBaseSharedBuffer
-