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 ByteBuffers.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.IncorrectContentLengthExceptionNested classes/interfaces inherited from interface io.micronaut.http.body.stream.BufferConsumer
BufferConsumer.Upstream -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ReadBuffer rb) Add a given buffer to thisBaseSharedBuffer.
Not thread safe, caller must handle concurrency.voidcomplete()Implementation ofBufferConsumer.complete().
Not thread safe, caller must handle concurrency.voidImplementation 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, getExpectedLength, getLimits, getRootUpstream, logClaim, reserve0, setExpectedLength, setExpectedLengthFrom, subscribe0, subscribeFull0Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.body.stream.BufferConsumer
discard
-
Method Details
-
subscribeFull
-
add
Description copied from class:BaseSharedBufferAdd a given buffer to thisBaseSharedBuffer.
Not thread safe, caller must handle concurrency.- Specified by:
addin interfaceBufferConsumer- Overrides:
addin classBaseSharedBuffer- Parameters:
rb- The buffer
-
error
Description copied from class:BaseSharedBufferImplementation ofBufferConsumer.error(Throwable).
Not thread safe, caller must handle concurrency.- Specified by:
errorin interfaceBufferConsumer- Overrides:
errorin classBaseSharedBuffer- Parameters:
e- The error
-
complete
public void complete()Description copied from class:BaseSharedBufferImplementation ofBufferConsumer.complete().
Not thread safe, caller must handle concurrency.- Specified by:
completein interfaceBufferConsumer- Overrides:
completein classBaseSharedBuffer
-