Package | Description |
---|---|
org.springframework.core.codec | |
org.springframework.core.io.buffer |
Generic abstraction for working with byte buffer implementations.
|
Modifier and Type | Method and Description |
---|---|
DataBuffer |
DataBufferDecoder.decode(DataBuffer buffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
DataBuffer |
ByteArrayEncoder.encodeValue(byte[] bytes,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints) |
DataBuffer |
ByteBufferEncoder.encodeValue(ByteBuffer byteBuffer,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints) |
DataBuffer |
CharSequenceEncoder.encodeValue(CharSequence charSequence,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints) |
DataBuffer |
DataBufferEncoder.encodeValue(DataBuffer buffer,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints) |
default DataBuffer |
Encoder.encodeValue(T value,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints)
Encode an Object of type T to a data buffer.
|
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Flux<DataBuffer> |
DataBufferDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
ByteArrayEncoder.encode(org.reactivestreams.Publisher<? extends byte[]> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
ByteBufferEncoder.encode(org.reactivestreams.Publisher<? extends ByteBuffer> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
CharSequenceEncoder.encode(org.reactivestreams.Publisher<? extends CharSequence> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
DataBufferEncoder.encode(org.reactivestreams.Publisher<? extends DataBuffer> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
ResourceRegionEncoder.encode(org.reactivestreams.Publisher<? extends ResourceRegion> input,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
AbstractSingleValueEncoder.encode(org.reactivestreams.Publisher<? extends T> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
Encoder.encode(org.reactivestreams.Publisher<? extends T> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Encode a stream of Objects of type
T into a DataBuffer
output stream. |
protected reactor.core.publisher.Flux<DataBuffer> |
ResourceEncoder.encode(Resource resource,
DataBufferFactory bufferFactory,
ResolvableType type,
MimeType mimeType,
Map<String,Object> hints) |
protected abstract reactor.core.publisher.Flux<DataBuffer> |
AbstractSingleValueEncoder.encode(T t,
DataBufferFactory dataBufferFactory,
ResolvableType type,
MimeType mimeType,
Map<String,Object> hints)
Encode
T to an output DataBuffer stream. |
Modifier and Type | Method and Description |
---|---|
String |
StringDecoder.decode(DataBuffer dataBuffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
ByteBuffer |
ByteBufferDecoder.decode(DataBuffer dataBuffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
byte[] |
ByteArrayDecoder.decode(DataBuffer dataBuffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
default T |
Decoder.decode(DataBuffer buffer,
ResolvableType targetType,
MimeType mimeType,
Map<String,Object> hints)
Decode a data buffer to an Object of type T.
|
Resource |
ResourceDecoder.decode(DataBuffer dataBuffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
DataBuffer |
DataBufferDecoder.decode(DataBuffer buffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
protected T |
AbstractDataBufferDecoder.decodeDataBuffer(DataBuffer buffer,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Deprecated.
as of 5.2, please implement
Decoder.decode(DataBuffer, ResolvableType, MimeType, Map) instead |
DataBuffer |
DataBufferEncoder.encodeValue(DataBuffer buffer,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints) |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Flux<String> |
StringDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<T> |
Decoder.decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Flux of T . |
reactor.core.publisher.Flux<Resource> |
ResourceDecoder.decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<T> |
AbstractDataBufferDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
DataBufferDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Mono<T> |
AbstractDecoder.decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Mono<T> |
Decoder.decodeToMono(org.reactivestreams.Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Mono of T . |
reactor.core.publisher.Mono<T> |
AbstractDataBufferDecoder.decodeToMono(org.reactivestreams.Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
reactor.core.publisher.Flux<DataBuffer> |
DataBufferEncoder.encode(org.reactivestreams.Publisher<? extends DataBuffer> inputStream,
DataBufferFactory bufferFactory,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints) |
Modifier and Type | Interface and Description |
---|---|
interface |
PooledDataBuffer
Extension of
DataBuffer that allows for buffer that share
a memory pool. |
Modifier and Type | Class and Description |
---|---|
class |
DataBufferWrapper
Provides a convenient implementation of the
DataBuffer interface
that can be overridden to adapt the delegate. |
class |
DefaultDataBuffer
Default implementation of the
DataBuffer interface that uses a
ByteBuffer internally. |
class |
NettyDataBuffer
Implementation of the
DataBuffer interface that wraps a Netty
ByteBuf . |
Modifier and Type | Method and Description |
---|---|
static <T extends DataBuffer> |
DataBufferUtils.retain(T dataBuffer)
Retain the given data buffer, if it is a
PooledDataBuffer . |
Modifier and Type | Method and Description |
---|---|
DataBuffer |
DataBufferFactory.allocateBuffer()
Allocate a data buffer of a default initial capacity.
|
DataBuffer |
DataBufferFactory.allocateBuffer(int initialCapacity)
Allocate a data buffer of the given initial capacity.
|
DataBuffer |
DataBufferWrapper.capacity(int capacity) |
DataBuffer |
DataBuffer.capacity(int capacity)
Set the number of bytes that this buffer can contain.
|
DataBuffer |
DataBufferWrapper.dataBuffer()
Return the wrapped delegate.
|
DataBuffer |
DataBufferWrapper.ensureCapacity(int capacity) |
DataBuffer |
DefaultDataBuffer.ensureCapacity(int length) |
DataBuffer |
NettyDataBuffer.ensureCapacity(int capacity) |
default DataBuffer |
DataBuffer.ensureCapacity(int capacity)
Ensure that the current buffer has enough
writableByteCount()
to write the amount of data given as an argument. |
DataBuffer |
NettyDataBufferFactory.join(List<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed of the dataBuffers elements joined together. |
DataBuffer |
DataBufferFactory.join(List<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed of the dataBuffers elements joined together. |
DataBuffer |
DataBufferWrapper.read(byte[] destination) |
DataBuffer |
DataBuffer.read(byte[] destination)
Read this buffer's data into the specified destination, starting at the current
reading position of this buffer.
|
DataBuffer |
DataBufferWrapper.read(byte[] destination,
int offset,
int length) |
DataBuffer |
DataBuffer.read(byte[] destination,
int offset,
int length)
Read at most
length bytes of this buffer into the specified destination,
starting at the current reading position of this buffer. |
DataBuffer |
DataBufferWrapper.readPosition(int readPosition) |
DataBuffer |
DataBuffer.readPosition(int readPosition)
Set the position from which this buffer will read.
|
DataBuffer |
LimitedDataBufferList.remove(int index) |
DataBuffer |
DataBufferWrapper.retainedSlice(int index,
int length) |
default DataBuffer |
DataBuffer.retainedSlice(int index,
int length)
Create a new
DataBuffer whose contents is a shared, retained subsequence of this
data buffer's content. |
DataBuffer |
LimitedDataBufferList.set(int index,
DataBuffer element) |
DataBuffer |
DataBufferWrapper.slice(int index,
int length) |
DataBuffer |
DataBuffer.slice(int index,
int length)
Create a new
DataBuffer whose contents is a shared subsequence of this
data buffer's content. |
DataBuffer |
NettyDataBufferFactory.wrap(byte[] bytes) |
DataBuffer |
DataBufferFactory.wrap(byte[] bytes)
Wrap the given
byte array in a DataBuffer . |
DataBuffer |
DataBufferFactory.wrap(ByteBuffer byteBuffer)
Wrap the given
ByteBuffer in a DataBuffer . |
DataBuffer |
DataBufferWrapper.write(byte b) |
DataBuffer |
DataBuffer.write(byte b)
Write a single byte into this buffer at the current writing position.
|
DataBuffer |
DataBufferWrapper.write(byte[] source) |
DataBuffer |
DataBuffer.write(byte[] source)
Write the given source into this buffer, starting at the current writing position
of this buffer.
|
DataBuffer |
DataBufferWrapper.write(byte[] source,
int offset,
int length) |
DataBuffer |
DataBuffer.write(byte[] source,
int offset,
int length)
Write at most
length bytes of the given source into this buffer, starting
at the current writing position of this buffer. |
DataBuffer |
DataBufferWrapper.write(ByteBuffer... buffers) |
DataBuffer |
DataBuffer.write(ByteBuffer... buffers)
Write one or more
ByteBuffer to this buffer, starting at the current
writing position. |
DataBuffer |
DataBufferWrapper.write(CharSequence charSequence,
Charset charset) |
DataBuffer |
NettyDataBuffer.write(CharSequence charSequence,
Charset charset) |
default DataBuffer |
DataBuffer.write(CharSequence charSequence,
Charset charset)
Write the given
CharSequence using the given Charset ,
starting at the current writing position. |
DataBuffer |
DataBufferWrapper.write(DataBuffer... buffers) |
DataBuffer |
DataBuffer.write(DataBuffer... buffers)
Write one or more
DataBuffer s to this buffer, starting at the current
writing position. |
DataBuffer |
DataBufferWrapper.writePosition(int writePosition) |
DataBuffer |
DataBuffer.writePosition(int writePosition)
Set the position to which this buffer will write.
|
Modifier and Type | Method and Description |
---|---|
static reactor.core.publisher.Mono<DataBuffer> |
DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed from joining together the given
dataBuffers elements. |
static reactor.core.publisher.Mono<DataBuffer> |
DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> buffers,
int maxByteCount)
Variant of
DataBufferUtils.join(Publisher) that behaves the same way up until
the specified max number of bytes to buffer. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.read(Path path,
DataBufferFactory bufferFactory,
int bufferSize,
OpenOption... options)
Read bytes from the given file
Path into a Flux of DataBuffer s. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.read(Resource resource,
DataBufferFactory bufferFactory,
int bufferSize)
Read the given
Resource into a Flux of DataBuffer s. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.read(Resource resource,
long position,
DataBufferFactory bufferFactory,
int bufferSize)
Read the given
Resource into a Flux of DataBuffer s
starting at the given position. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.readAsynchronousFileChannel(Callable<AsynchronousFileChannel> channelSupplier,
DataBufferFactory bufferFactory,
int bufferSize)
Obtain a
AsynchronousFileChannel from the given supplier, and read
it into a Flux of DataBuffer s. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.readAsynchronousFileChannel(Callable<AsynchronousFileChannel> channelSupplier,
long position,
DataBufferFactory bufferFactory,
int bufferSize)
Obtain a
AsynchronousFileChannel from the given supplier, and
read it into a Flux of DataBuffer s, starting at the given
position. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.readByteChannel(Callable<ReadableByteChannel> channelSupplier,
DataBufferFactory bufferFactory,
int bufferSize)
|
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.readInputStream(Callable<InputStream> inputStreamSupplier,
DataBufferFactory bufferFactory,
int bufferSize)
|
static Consumer<DataBuffer> |
DataBufferUtils.releaseConsumer()
Return a consumer that calls
DataBufferUtils.release(DataBuffer) on all
passed data buffers. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.skipUntilByteCount(org.reactivestreams.Publisher<? extends DataBuffer> publisher,
long maxByteCount)
Skip buffers from the given
Publisher until the total
byte count reaches
the given maximum byte count, or until the publisher is complete. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.takeUntilByteCount(org.reactivestreams.Publisher<? extends DataBuffer> publisher,
long maxByteCount)
Relay buffers from the given
Publisher until the total
byte count reaches
the given maximum byte count, or until the publisher is complete. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<? extends DataBuffer> source,
AsynchronousFileChannel channel,
long position)
Write the given stream of
DataBuffers to the given
AsynchronousFileChannel . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
AsynchronousFileChannel channel)
Write the given stream of
DataBuffers to the given
AsynchronousFileChannel . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
OutputStream outputStream)
Write the given stream of
DataBuffers to the given
OutputStream . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
WritableByteChannel channel)
Write the given stream of
DataBuffers to the given
WritableByteChannel . |
Modifier and Type | Method and Description |
---|---|
boolean |
LimitedDataBufferList.add(DataBuffer buffer) |
void |
LimitedDataBufferList.add(int index,
DataBuffer buffer) |
int |
DataBufferUtils.Matcher.match(DataBuffer dataBuffer)
Find the first matching delimiter and return the index of the last
byte of the delimiter, or
-1 if not found. |
static boolean |
DataBufferUtils.release(DataBuffer dataBuffer)
Release the given data buffer, if it is a
PooledDataBuffer and
has been allocated. |
DataBuffer |
LimitedDataBufferList.set(int index,
DataBuffer element) |
static io.netty.buffer.ByteBuf |
NettyDataBufferFactory.toByteBuf(DataBuffer buffer)
Return the given Netty
DataBuffer as a ByteBuf . |
DataBuffer |
DataBufferWrapper.write(DataBuffer... buffers) |
DefaultDataBuffer |
DefaultDataBuffer.write(DataBuffer... buffers) |
NettyDataBuffer |
NettyDataBuffer.write(DataBuffer... buffers) |
DataBuffer |
DataBuffer.write(DataBuffer... buffers)
Write one or more
DataBuffer s to this buffer, starting at the current
writing position. |
Modifier and Type | Method and Description |
---|---|
boolean |
LimitedDataBufferList.addAll(Collection<? extends DataBuffer> collection) |
boolean |
LimitedDataBufferList.addAll(int index,
Collection<? extends DataBuffer> collection) |
DefaultDataBuffer |
DefaultDataBufferFactory.join(List<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed of the dataBuffers elements joined together. |
DataBuffer |
NettyDataBufferFactory.join(List<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed of the dataBuffers elements joined together. |
DataBuffer |
DataBufferFactory.join(List<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed of the dataBuffers elements joined together. |
static reactor.core.publisher.Mono<DataBuffer> |
DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> dataBuffers)
Return a new
DataBuffer composed from joining together the given
dataBuffers elements. |
static reactor.core.publisher.Mono<DataBuffer> |
DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> buffers,
int maxByteCount)
Variant of
DataBufferUtils.join(Publisher) that behaves the same way up until
the specified max number of bytes to buffer. |
boolean |
LimitedDataBufferList.removeIf(Predicate<? super DataBuffer> filter) |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.skipUntilByteCount(org.reactivestreams.Publisher<? extends DataBuffer> publisher,
long maxByteCount)
Skip buffers from the given
Publisher until the total
byte count reaches
the given maximum byte count, or until the publisher is complete. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.takeUntilByteCount(org.reactivestreams.Publisher<? extends DataBuffer> publisher,
long maxByteCount)
Relay buffers from the given
Publisher until the total
byte count reaches
the given maximum byte count, or until the publisher is complete. |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<? extends DataBuffer> source,
AsynchronousFileChannel channel,
long position)
Write the given stream of
DataBuffers to the given
AsynchronousFileChannel . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
AsynchronousFileChannel channel)
Write the given stream of
DataBuffers to the given
AsynchronousFileChannel . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
OutputStream outputStream)
Write the given stream of
DataBuffers to the given
OutputStream . |
static reactor.core.publisher.Mono<Void> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
Path destination,
OpenOption... options)
Write the given stream of
DataBuffers to the given
file Path . |
static reactor.core.publisher.Flux<DataBuffer> |
DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source,
WritableByteChannel channel)
Write the given stream of
DataBuffers to the given
WritableByteChannel . |
Constructor and Description |
---|
DataBufferWrapper(DataBuffer delegate)
Create a new
DataBufferWrapper that wraps the given buffer. |