primary
- Parameters:
primary- The consumer ornullto discard the data- Returns:
- The upstream to signal backpressure
SB - The shared buffer typeByteBody, CloseableByteBody, Closeable, AutoCloseableReactiveByteBufferByteBody, StreamingNettyByteBodyByteBodys based on a
BaseSharedBuffer.ByteBody.BodyDiscardedException, ByteBody.SplitBackpressureModeprotected BaseStreamingByteBody(SB sharedBuffer,
BufferConsumer.Upstream upstream) final @NonNull CloseableByteBodyprotected abstract @NonNull BaseStreamingByteBody<SB>derive(BufferConsumer.Upstream upstream) final @NonNull OptionalLongContent-Length or from
previous buffering).final @NonNull CloseableByteBodymove()CloseableByteBody with the same content but an independent lifecycle,
claiming this body in the process.abstract BufferConsumer.Upstreamprimary(@Nullable BufferConsumer primary) final @NonNull InputStreamInputStream.final @NonNull Publisher<ReadBuffer>ReadBuffers.buffer, bufferFlow, bufferFlow, failClaim, recordClosed, recordPrimaryOp, toByteArrayPublisherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuffer, split, split, toByteArrayPublisher, toByteBufferPublisher, touchcloseByteBodyContent-Length or from
previous buffering). The actual length will never exceed this value, though it may sometimes
be lower if there is a connection error.
This value may go from OptionalLong.empty() to a known value over the lifetime of
this body.
This is not a primary operation and does not modify this ByteBody.
expectedLength in interface ByteBodyprimary - The consumer or null to discard the datamove().upstream - The upstreamByteBodyReadBuffers. Note that the caller must take
care to release the returned buffers.
This is a primary operation. After this operation, no other primary operation or
ByteBody.split() may be done.
toReadBufferPublisher in interface ByteBodytoReadBufferPublisher in class InternalByteBodyByteBodyInputStream.
This is a primary operation. After this operation, no other primary operation or
ByteBody.split() may be done.
toInputStream in interface ByteBodyByteBodyCloseableByteBody with the same content but an independent lifecycle,
claiming this body in the process.
This is a primary operation. After this operation, no other primary operation or
ByteBody.split() may be done.
The purpose of this method is to move the data to a different component in an
application, making clear that the receiving component claims ownership of the body. If the
sending component then closes the original ByteBody for example, it will have no
impact on the new CloseableByteBody that the receiver is working with.
move in interface ByteBodyCloseableByteBody with the same content.ByteBodyDiscarding may be implemented e.g. by closing the input side of an HTTP/2 stream.
This method must be called before any primary operation.
allowDiscard in interface ByteBodyallowDiscard in interface CloseableByteBody