Top Description Inners Fields Constructors Methods
reactor.netty

public Class ByteBufMono

extends MonoOperator<ByteBuf, ByteBuf>
Class Inheritance
Known Direct Subclasses
reactor.netty.ByteBufMono.ByteBufMonoFuseable
Imports
java.io.IOException, .InputStream, java.nio.ByteBuffer, java.nio.charset.Charset, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, io.netty.buffer.ByteBuf, .ByteBufAllocator, .ByteBufInputStream, io.netty.util.IllegalReferenceCountException, org.reactivestreams.Publisher, reactor.core.CoreSubscriber, .Fuseable, reactor.core.publisher.Mono, .MonoOperator

A decorating Mono NettyInbound with various ByteBuf related operations.
Author
Stephane Maldini

Nested and Inner Type Summary

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

Field Summary

Inherited from reactor.core.publisher.MonoOperator:
source

Constructor Summary

AccessConstructor and Description
pack-priv
ByteBufMono(Mono<?> source)

Method Summary

Modifier and TypeMethod and Description
public final Mono<byte[]>

Returns:

a byte[] inbound Mono
asByteArray
()

a byte[] inbound Mono.

public final Mono<ByteBuffer>

Returns:

a ByteBuffer inbound Mono
asByteBuffer
()

a ByteBuffer inbound Mono.

public final Mono<InputStream>

Returns:

a InputStream inbound Mono
asInputStream
()

Convert to an InputStream inbound Mono

Note

Auto memory release is disabled.

public final Mono<String>

Returns:

a String inbound Mono
asString
()

a String inbound Mono.

public final Mono<String>

Returns:

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

a String inbound Mono.

public static ByteBufMono

Returns:

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

Decorate as ByteBufMono.

public static ByteBufMono

Returns:

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

Decorate as ByteBufMono.

pack-priv static ByteBufMono
maybeFuse(Mono<?> source)

public final ByteBufMono

Returns:

ByteBufMono of retained ByteBuf
retain
()

Disable auto memory release on each signal published in order to prevent premature recycling when buffers are accumulated downstream (async).

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

Implements abstract reactor.core.publisher.Mono.subscribe.

Implements reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.
Inherited from reactor.core.publisher.MonoOperator:
scanUnsafe

Constructor Detail

ByteBufMonoback to summary
pack-priv ByteBufMono(Mono<?> source)

Method Detail

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

a byte[] inbound Mono.

Returns:Mono<byte[]>

a byte[] inbound Mono

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

a ByteBuffer inbound Mono.

Returns:Mono<ByteBuffer>

a ByteBuffer inbound Mono

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

Convert to an InputStream inbound Mono

Note

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

Returns:Mono<InputStream>

a InputStream inbound Mono

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

a String inbound Mono.

Returns:Mono<String>

a String inbound Mono

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

a String inbound Mono.

Parameters
charset:Charset

the decoding charset

Returns:Mono<String>

a String inbound Mono

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

Decorate as ByteBufMono.

Parameters
source:Publisher<? extends String>

publisher to decorate

Returns:ByteBufMono

a ByteBufMono

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

Decorate as ByteBufMono.

Parameters
source:Publisher<? extends String>

publisher to decorate

charset:Charset

the encoding charset

allocator:ByteBufAllocator

the ByteBufAllocator

Returns:ByteBufMono

a ByteBufMono

maybeFuseback to summary
pack-priv static ByteBufMono maybeFuse(Mono<?> source)
retainback to summary
public final ByteBufMono retain()

Disable auto memory release on each signal published in order to prevent premature recycling when buffers are accumulated downstream (async).

Returns:ByteBufMono

ByteBufMono of retained ByteBuf

subscribeback to summary
public void subscribe(CoreSubscriber<? super ByteBuf> actual)

Implements abstract reactor.core.publisher.Mono.subscribe.

Implements reactor.core.CorePublisher.subscribe.

Doc from reactor.core.publisher.Mono.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
actual:CoreSubscriber<? super ByteBuf>

the Subscriber interested into the published sequence

Annotations
@Override
reactor.netty back to summary

pack-priv final Class ByteBufMono.ByteBufMonoFuseable

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

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from reactor.netty.ByteBufMono:
asByteArrayasByteBufferasInputStreamasStringasStringfromStringfromStringmaybeFuseretainsubscribe

Constructor Detail

ByteBufMonoFuseableback to summary
pack-priv ByteBufMonoFuseable(Mono<?> source)
reactor.netty back to summary

pack-priv final Class ByteBufMono.ReleasingInputStream

extends ByteBufInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final ByteBuf
pack-priv static final AtomicIntegerFieldUpdater<ByteBufMono.ReleasingInputStream>
pack-priv volatile int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides io.netty.buffer.ByteBufInputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
Inherited from io.netty.buffer.ByteBufInputStream:
availablemarkmarkSupportedreadreadreadBooleanreadBytereadBytesreadCharreadDoublereadFloatreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedShortreadUTFresetskipskipBytes

Field Detail

bbback to summary
pack-priv final ByteBuf bb
CLOSEback to summary
pack-priv static final AtomicIntegerFieldUpdater<ByteBufMono.ReleasingInputStream> CLOSE
closedback to summary
pack-priv volatile int closed

Hides io.netty.buffer.ByteBufInputStream.closed.

Constructor Detail

ReleasingInputStreamback to summary
pack-priv ReleasingInputStream(ByteBuf bb)

Method Detail

closeback to summary
public void close() throws IOException

Overrides io.netty.buffer.ByteBufInputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.InputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.