Top Description Inners Fields Constructors Methods
reactor.netty5

public Class BufferFlux

extends FluxOperator<Buffer, Buffer>
Class Inheritance
Known Direct Subclasses
reactor.netty5.BufferFlux.BufferFluxFuseable
Imports
io.netty5.buffer.BufferInputStream, .Buffer, .BufferAllocator, io.netty5.util.Send, io.netty5.channel.socket.DatagramPacket, org.reactivestreams.Publisher, reactor.core.CoreSubscriber, .Fuseable, reactor.core.publisher.Flux, .FluxOperator, .Mono, java.io.IOException, .InputStream, java.nio.ByteBuffer, java.nio.channels.FileChannel, java.nio.charset.Charset, java.nio.file.Path, java.util.Objects, java.util.concurrent.atomic.AtomicReferenceFieldUpdater, java.util.function.Function, .Supplier

A decorating Flux NettyInbound with various Buffer related operations.
Author
Violeta Georgieva
Since
2.0.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final BufferAllocator
pack-priv static final Function<Object, Buffer>
bufferExtractorFunction

A channel object to Buffer transformer

pack-priv static final int
Inherited from reactor.core.publisher.FluxOperator:
source

Constructor Summary

AccessConstructor and Description
pack-priv
BufferFlux(Flux<Buffer> source, BufferAllocator allocator)

Method Summary

Modifier and TypeMethod and Description
public final BufferMono

Returns:

BufferMono of aggregated Buffer
aggregate
()

Aggregate subsequent byte buffers into a single buffer.

public final Flux<byte[]>

Returns:

a byte[] inbound Flux
asByteArray
()

Convert to a byte[] inbound Flux

public final Flux<ByteBuffer>

Returns:

a ByteBuffer inbound Flux
asByteBuffer
()

Convert to a ByteBuffer inbound Flux

public final Flux<InputStream>

Returns:

a InputStream inbound Flux
asInputStream
()

Convert to an InputStream inbound Flux

Note

The underlying Buffer will be released only when InputStream#close() is invoked.

public final Flux<String>

Returns:

a String inbound Flux
asString
()

Convert to a String inbound Flux using the default Charset.

public final Flux<String>

Returns:

a String inbound Flux
asString
(Charset
the decoding charset
charset
)

Convert to a String inbound Flux using the provided Charset.

public static BufferFlux

Returns:

a BufferFlux
fromInbound
(Publisher<?>
publisher to decorate
source
)

Decorate as BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromInbound
(Publisher<?>
publisher to decorate
source
,
BufferAllocator
the channel BufferAllocator
allocator
)

Decorate as BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromInbound
(Publisher<?>
publisher to decorate
source
,
BufferAllocator
the channel BufferAllocator
allocator
,
Function<Object, Buffer>
a function that extracts a Buffer from the given Object
bufferExtractor
)

Decorate as BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromPath
(Path
the path to the resource to stream
path
)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a default maximum size of 500K into the returned BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromPath
(Path
the path to the resource to stream
path
,
int
the maximum per-item Buffer size
maxChunkSize
)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a given maximum size into the returned BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromPath
(Path
the path to the resource to stream
path
,
BufferAllocator
the channel BufferAllocator
allocator
)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a default maximum size of 500K into the returned BufferFlux, using the provided BufferAllocator.

public static BufferFlux

Returns:

a BufferFlux
fromPath
(Path
the path to the resource to stream
path
,
int
the maximum per-item Buffer size
maxChunkSize
,
BufferAllocator
the channel BufferAllocator
allocator
)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a given maximum size into the returned BufferFlux, using the provided BufferAllocator.

public static BufferFlux

Returns:

a BufferFlux
fromString
(Publisher<? extends String>
publisher to decorate
source
)

Decorate as BufferFlux

public static BufferFlux

Returns:

a BufferFlux
fromString
(Publisher<? extends String>
publisher to decorate
source
,
Charset
the encoding charset
charset
,
BufferAllocator allocator)

Decorate as BufferFlux

pack-priv static BufferFlux
maybeFuse(Flux<Buffer> source, BufferAllocator allocator)

public void
subscribe(CoreSubscriber<? super Buffer>
the Subscriber interested into the published sequence
s
)

Implements abstract reactor.core.publisher.Flux.subscribe.

Implements reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.
public final Flux<Buffer>

Returns:

Flux of split Buffers
transferOwnership
()

Returns Flux of split Buffers.

Inherited from reactor.core.publisher.FluxOperator:
scanUnsafe

Field Detail

allocback to summary
pack-priv final BufferAllocator alloc
bufferExtractorFunctionback to summary
pack-priv static final Function<Object, Buffer> bufferExtractorFunction

A channel object to Buffer transformer

MAX_CHUNK_SIZEback to summary
pack-priv static final int MAX_CHUNK_SIZE

Constructor Detail

BufferFluxback to summary
pack-priv BufferFlux(Flux<Buffer> source, BufferAllocator allocator)

Method Detail

aggregateback to summary
public final BufferMono aggregate()

Aggregate subsequent byte buffers into a single buffer.

Returns:BufferMono

BufferMono of aggregated Buffer

asByteArrayback to summary
public final Flux<byte[]> asByteArray()

Convert to a byte[] inbound Flux

Returns:Flux<byte[]>

a byte[] inbound Flux

asByteBufferback to summary
public final Flux<ByteBuffer> asByteBuffer()

Convert to a ByteBuffer inbound Flux

Returns:Flux<ByteBuffer>

a ByteBuffer inbound Flux

asInputStreamback to summary
public final Flux<InputStream> asInputStream()

Convert to an InputStream inbound Flux

Note

The underlying Buffer will be released only when InputStream#close() is invoked. Ensure InputStream#close() is invoked for any terminal signal: complete | error | cancel.

Returns:Flux<InputStream>

a InputStream inbound Flux

asStringback to summary
public final Flux<String> asString()

Convert to a String inbound Flux using the default Charset.

Returns:Flux<String>

a String inbound Flux

asStringback to summary
public final Flux<String> asString(Charset charset)

Convert to a String inbound Flux using the provided Charset.

Parameters
charset:Charset

the decoding charset

Returns:Flux<String>

a String inbound Flux

fromInboundback to summary
public static BufferFlux fromInbound(Publisher<?> source)

Decorate as BufferFlux

Parameters
source:Publisher<?>

publisher to decorate

Returns:BufferFlux

a BufferFlux

fromInboundback to summary
public static BufferFlux fromInbound(Publisher<?> source, BufferAllocator allocator)

Decorate as BufferFlux

Parameters
source:Publisher<?>

publisher to decorate

allocator:BufferAllocator

the channel BufferAllocator

Returns:BufferFlux

a BufferFlux

fromInboundback to summary
public static BufferFlux fromInbound(Publisher<?> source, BufferAllocator allocator, Function<Object, Buffer> bufferExtractor)

Decorate as BufferFlux

Parameters
source:Publisher<?>

publisher to decorate

allocator:BufferAllocator

the channel BufferAllocator

bufferExtractor:Function<Object, Buffer>

a function that extracts a Buffer from the given Object

Returns:BufferFlux

a BufferFlux

fromPathback to summary
public static BufferFlux fromPath(Path path)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a default maximum size of 500K into the returned BufferFlux

Parameters
path:Path

the path to the resource to stream

Returns:BufferFlux

a BufferFlux

fromPathback to summary
public static BufferFlux fromPath(Path path, int maxChunkSize)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a given maximum size into the returned BufferFlux

Parameters
path:Path

the path to the resource to stream

maxChunkSize:int

the maximum per-item Buffer size

Returns:BufferFlux

a BufferFlux

fromPathback to summary
public static BufferFlux fromPath(Path path, BufferAllocator allocator)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a default maximum size of 500K into the returned BufferFlux, using the provided BufferAllocator.

Parameters
path:Path

the path to the resource to stream

allocator:BufferAllocator

the channel BufferAllocator

Returns:BufferFlux

a BufferFlux

fromPathback to summary
public static BufferFlux fromPath(Path path, int maxChunkSize, BufferAllocator allocator)

Open a java.nio.channels.FileChannel from a path and stream Buffer chunks with a given maximum size into the returned BufferFlux, using the provided BufferAllocator.

Parameters
path:Path

the path to the resource to stream

maxChunkSize:int

the maximum per-item Buffer size

allocator:BufferAllocator

the channel BufferAllocator

Returns:BufferFlux

a BufferFlux

fromStringback to summary
public static BufferFlux fromString(Publisher<? extends String> source)

Decorate as BufferFlux

Parameters
source:Publisher<? extends String>

publisher to decorate

Returns:BufferFlux

a BufferFlux

fromStringback to summary
public static BufferFlux fromString(Publisher<? extends String> source, Charset charset, BufferAllocator allocator)

Decorate as BufferFlux

Parameters
source:Publisher<? extends String>

publisher to decorate

charset:Charset

the encoding charset

allocator:BufferAllocator

the BufferAllocator

Returns:BufferFlux

a BufferFlux

maybeFuseback to summary
pack-priv static BufferFlux maybeFuse(Flux<Buffer> source, BufferAllocator allocator)
subscribeback to summary
public void subscribe(CoreSubscriber<? super Buffer> s)

Implements abstract reactor.core.publisher.Flux.subscribe.

Implements reactor.core.CorePublisher.subscribe.

Doc from reactor.core.publisher.Flux.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.

In addition to behave as expected by Publisher#subscribe(Subscriber) in a controlled manner, it supports direct subscribe-time Context passing.

Parameters
s:CoreSubscriber<? super Buffer>

the Subscriber interested into the published sequence

Annotations
@Override
transferOwnershipback to summary
public final Flux<Buffer> transferOwnership()

Returns Flux of split Buffers. This transfers the ownership to the recipient. The caller of this method should ensure the Buffers are closed.

Returns:Flux<Buffer>

Flux of split Buffers

reactor.netty5 back to summary

pack-priv final Class BufferFlux.BufferFluxFuseable

extends BufferFlux
implements Fuseable
Class Inheritance
All Implemented Interfaces
reactor.core.Fuseable

Field Summary

Inherited from reactor.netty5.BufferFlux:
allocbufferExtractorFunctionMAX_CHUNK_SIZE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from reactor.netty5.BufferFlux:
aggregateasByteArrayasByteBufferasInputStreamasStringasStringfromInboundfromInboundfromInboundfromPathfromPathfromPathfromPathfromStringfromStringmaybeFusesubscribetransferOwnership

Constructor Detail

BufferFluxFuseableback to summary
pack-priv BufferFluxFuseable(Flux<Buffer> source, BufferAllocator allocator)
reactor.netty5 back to summary

pack-priv final Class BufferFlux.DeferredAggregate

extends Object
implements Supplier<Mono<Buffer>>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier

Field Summary

Modifier and TypeField and Description
pack-priv final BufferAllocator
pack-priv static final AtomicReferenceFieldUpdater<BufferFlux.DeferredAggregate, Buffer>
pack-priv volatile Buffer
pack-priv final Flux<Buffer>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Mono<Buffer>
get()

Implements java.util.function.Supplier.get.

Gets a result.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocback to summary
pack-priv final BufferAllocator alloc
COMPOSITE_BUFFERback to summary
pack-priv static final AtomicReferenceFieldUpdater<BufferFlux.DeferredAggregate, Buffer> COMPOSITE_BUFFER
compositeBufferback to summary
pack-priv volatile Buffer compositeBuffer
sourceback to summary
pack-priv final Flux<Buffer> source

Constructor Detail

DeferredAggregateback to summary
pack-priv DeferredAggregate(Flux<Buffer> source, BufferAllocator alloc)

Method Detail

getback to summary
public Mono<Buffer> get()

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Returns:Mono<Buffer>

a result

Annotations
@Override
@SuppressWarnings:rawtypes