Uses of Interface
org.springframework.core.io.buffer.DataBuffer
Package
Description
Generic abstraction for working with byte buffer implementations.
-
Uses of DataBuffer in org.springframework.core.codec
Modifier and TypeMethodDescriptionDataBufferDecoder.decode
(DataBuffer buffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) ByteArrayEncoder.encodeValue
(byte[] bytes, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) ByteBufferEncoder.encodeValue
(ByteBuffer byteBuffer, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) CharSequenceEncoder.encodeValue
(CharSequence charSequence, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) 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.Netty5BufferEncoder.encodeValue
(io.netty5.buffer.Buffer buffer, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) NettyByteBufEncoder.encodeValue
(io.netty.buffer.ByteBuf byteBuf, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<DataBuffer>
DataBufferDecoder.decode
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) final reactor.core.publisher.Flux<DataBuffer>
AbstractSingleValueEncoder.encode
(Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, 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) EncodeT
to an outputDataBuffer
stream.reactor.core.publisher.Flux<DataBuffer>
ByteArrayEncoder.encode
(Publisher<? extends byte[]> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
ByteBufferEncoder.encode
(Publisher<? extends ByteBuffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
CharSequenceEncoder.encode
(Publisher<? extends CharSequence> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
DataBufferEncoder.encode
(Publisher<? extends DataBuffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
Encoder.encode
(Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Encode a stream of Objects of typeT
into aDataBuffer
output stream.reactor.core.publisher.Flux<DataBuffer>
Netty5BufferEncoder.encode
(Publisher<? extends io.netty5.buffer.Buffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
NettyByteBufEncoder.encode
(Publisher<? extends io.netty.buffer.ByteBuf> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) protected reactor.core.publisher.Flux<DataBuffer>
ResourceEncoder.encode
(Resource resource, DataBufferFactory bufferFactory, ResolvableType type, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
ResourceRegionEncoder.encode
(Publisher<? extends ResourceRegion> input, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Modifier and TypeMethodDescriptionbyte[]
ByteArrayDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) ByteBufferDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) DataBufferDecoder.decode
(DataBuffer buffer, 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.io.netty5.buffer.Buffer
Netty5BufferDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) io.netty.buffer.ByteBuf
NettyByteBufDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) ResourceDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) StringDecoder.decode
(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) protected T
AbstractDataBufferDecoder.decodeDataBuffer
(DataBuffer buffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Deprecated.DataBufferEncoder.encodeValue
(DataBuffer buffer, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) static void
Hints.touchDataBuffer
(DataBuffer buffer, Map<String, Object> hints, Log logger) If the hints contain aHints.LOG_PREFIX_HINT
and the given logger has DEBUG level enabled, apply the log prefix as a hint to the given buffer viaDataBufferUtils.touch(DataBuffer, Object)
.Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<T>
AbstractDataBufferDecoder.decode
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>
DataBufferDecoder.decode
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<T>
Decoder.decode
(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode aDataBuffer
input stream into a Flux ofT
.reactor.core.publisher.Flux<Resource>
ResourceDecoder.decode
(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<String>
StringDecoder.decode
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<T>
AbstractDataBufferDecoder.decodeToMono
(Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<T>
AbstractDecoder.decodeToMono
(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<T>
Decoder.decodeToMono
(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode aDataBuffer
input stream into a Mono ofT
.reactor.core.publisher.Flux<DataBuffer>
DataBufferEncoder.encode
(Publisher<? extends DataBuffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) -
Uses of DataBuffer in org.springframework.core.io.buffer
Modifier and TypeInterfaceDescriptioninterface
Extension ofDataBuffer
that allows for buffers that can be used in atry
-with-resources statement.interface
Extension ofDataBuffer
that allows for buffers that share a memory pool.interface
Extension ofDataBuffer
that allows for buffers that can be given hints for debugging purposes.Modifier and TypeClassDescriptionclass
Provides a convenient implementation of theDataBuffer
interface that can be overridden to adapt the delegate.class
Default implementation of theDataBuffer
interface that uses aByteBuffer
internally.final class
Implementation of theDataBuffer
interface that wraps a Netty 5Buffer
.class
Implementation of theDataBuffer
interface that wraps a Netty 4ByteBuf
.Modifier and TypeMethodDescriptionstatic <T extends DataBuffer>
TDataBufferUtils.retain
(T dataBuffer) Retain the given data buffer, if it is aPooledDataBuffer
.static <T extends DataBuffer>
reactor.core.publisher.Flux<T>DataBufferUtils.skipUntilByteCount
(Publisher<T> publisher, long maxByteCount) Skip buffers from the givenPublisher
until the total byte count reaches the given maximum byte count, or until the publisher is complete.static <T extends DataBuffer>
reactor.core.publisher.Flux<T>DataBufferUtils.takeUntilByteCount
(Publisher<T> publisher, long maxByteCount) Relay buffers from the givenPublisher
until the total byte count reaches the given maximum byte count, or until the publisher is complete.static <T extends DataBuffer>
TAssociate the given hint with the data buffer if it is a pooled buffer and supports leak tracking.Modifier and TypeMethodDescriptionDataBufferFactory.allocateBuffer()
Deprecated.as of 6.0, in favor ofDataBufferFactory.allocateBuffer(int)
DataBufferFactory.allocateBuffer
(int initialCapacity) Allocate a data buffer of the given initial capacity.DataBuffer.capacity
(int capacity) Deprecated.as of 6.0, in favor ofensureWritable(int)
, which has different semanticsDataBufferWrapper.capacity
(int capacity) Deprecated.DefaultDataBuffer.capacity
(int capacity) Deprecated.DataBufferWrapper.dataBuffer()
Return the wrapped delegate.default DataBuffer
DataBuffer.ensureCapacity
(int capacity) Deprecated.since 6.0, in favor ofensureWritable(int)
DataBufferWrapper.ensureCapacity
(int capacity) Deprecated.DataBuffer.ensureWritable
(int capacity) Ensure that the current buffer has enoughwritableByteCount()
to write the amount of data given as an argument.DataBufferWrapper.ensureWritable
(int capacity) DefaultDataBuffer.ensureWritable
(int length) Netty5DataBuffer.ensureWritable
(int capacity) NettyDataBuffer.ensureWritable
(int capacity) DataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.Netty5DataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.NettyDataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.DataBuffer.read
(byte[] destination) Read this buffer's data into the specified destination, starting at the current reading position of this buffer.DataBuffer.read
(byte[] destination, int offset, int length) Read at mostlength
bytes of this buffer into the specified destination, starting at the current reading position of this buffer.DataBufferWrapper.read
(byte[] destination) DataBufferWrapper.read
(byte[] destination, int offset, int length) DataBuffer.readPosition
(int readPosition) Set the position from which this buffer will read.DataBufferWrapper.readPosition
(int readPosition) LimitedDataBufferList.remove
(int index) default DataBuffer
DataBuffer.retainedSlice
(int index, int length) Deprecated.as of 6.0, in favor ofsplit(int)
, which has different semanticsDataBufferWrapper.retainedSlice
(int index, int length) Deprecated.LimitedDataBufferList.set
(int index, DataBuffer element) DataBuffer.slice
(int index, int length) Deprecated.as of 6.0, in favor ofsplit(int)
, which has different semanticsDataBufferWrapper.slice
(int index, int length) Deprecated.Netty5DataBuffer.slice
(int index, int length) Deprecated.DataBuffer.split
(int index) Splits this data buffer into two at the given index.DataBufferWrapper.split
(int index) DefaultDataBuffer.split
(int index) Netty5DataBuffer.split
(int index) DataBufferFactory.wrap
(byte[] bytes) Wrap the givenbyte
array in aDataBuffer
.DataBufferFactory.wrap
(ByteBuffer byteBuffer) Wrap the givenByteBuffer
in aDataBuffer
.NettyDataBufferFactory.wrap
(byte[] bytes) DataBuffer.write
(byte b) Write a single byte into this buffer at the current writing position.DataBuffer.write
(byte[] source) Write the given source into this buffer, starting at the current writing position of this buffer.DataBuffer.write
(byte[] source, int offset, int length) Write at mostlength
bytes of the given source into this buffer, starting at the current writing position of this buffer.default DataBuffer
DataBuffer.write
(CharSequence charSequence, Charset charset) Write the givenCharSequence
using the givenCharset
, starting at the current writing position.DataBuffer.write
(ByteBuffer... buffers) Write one or moreByteBuffer
to this buffer, starting at the current writing position.DataBuffer.write
(DataBuffer... buffers) Write one or moreDataBuffer
s to this buffer, starting at the current writing position.DataBufferWrapper.write
(byte b) DataBufferWrapper.write
(byte[] source) DataBufferWrapper.write
(byte[] source, int offset, int length) DataBufferWrapper.write
(CharSequence charSequence, Charset charset) DataBufferWrapper.write
(ByteBuffer... buffers) DataBufferWrapper.write
(DataBuffer... buffers) Netty5DataBuffer.write
(CharSequence charSequence, Charset charset) NettyDataBuffer.write
(CharSequence charSequence, Charset charset) DataBuffer.writePosition
(int writePosition) Set the position to which this buffer will write.DataBufferWrapper.writePosition
(int writePosition) Modifier and TypeMethodDescriptionstatic reactor.core.publisher.Mono<DataBuffer>
DataBufferUtils.join
(Publisher<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of joining together the givendataBuffers
elements.static reactor.core.publisher.Mono<DataBuffer>
DataBufferUtils.join
(Publisher<? extends DataBuffer> buffers, int maxByteCount) Variant ofDataBufferUtils.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 filePath
into aFlux
ofDataBuffer
s.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.read
(Resource resource, long position, DataBufferFactory bufferFactory, int bufferSize) Read the givenResource
into aFlux
ofDataBuffer
s starting at the given position.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.read
(Resource resource, DataBufferFactory bufferFactory, int bufferSize) Read the givenResource
into aFlux
ofDataBuffer
s.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.readAsynchronousFileChannel
(Callable<AsynchronousFileChannel> channelSupplier, long position, DataBufferFactory bufferFactory, int bufferSize) Obtain anAsynchronousFileChannel
from the given supplier, and read it into aFlux
ofDataBuffer
s, starting at the given position.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.readAsynchronousFileChannel
(Callable<AsynchronousFileChannel> channelSupplier, DataBufferFactory bufferFactory, int bufferSize) Obtain aAsynchronousFileChannel
from the given supplier, and read it into aFlux
ofDataBuffer
s.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 callsDataBufferUtils.release(DataBuffer)
on all passed data buffers.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<? extends DataBuffer> source, AsynchronousFileChannel channel, long position) Write the given stream ofDataBuffers
to the givenAsynchronousFileChannel
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, OutputStream outputStream) Write the given stream ofDataBuffers
to the givenOutputStream
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, AsynchronousFileChannel channel) Write the given stream ofDataBuffers
to the givenAsynchronousFileChannel
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, WritableByteChannel channel) Write the given stream ofDataBuffers
to the givenWritableByteChannel
.Modifier and TypeMethodDescriptionvoid
LimitedDataBufferList.add
(int index, DataBuffer buffer) boolean
LimitedDataBufferList.add
(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.LimitedDataBufferList.set
(int index, DataBuffer element) static io.netty5.buffer.Buffer
Netty5DataBufferFactory.toBuffer
(DataBuffer buffer) Return the given NettyDataBuffer
as aBuffer
.static io.netty.buffer.ByteBuf
NettyDataBufferFactory.toByteBuf
(DataBuffer dataBuffer) Return the given NettyDataBuffer
as aByteBuf
.DataBuffer.write
(DataBuffer... buffers) Write one or moreDataBuffer
s to this buffer, starting at the current writing position.DataBufferWrapper.write
(DataBuffer... buffers) DefaultDataBuffer.write
(DataBuffer... dataBuffers) Netty5DataBuffer.write
(DataBuffer... dataBuffers) NettyDataBuffer.write
(DataBuffer... dataBuffers) Modifier and TypeMethodDescriptionboolean
LimitedDataBufferList.addAll
(int index, Collection<? extends DataBuffer> collection) boolean
LimitedDataBufferList.addAll
(Collection<? extends DataBuffer> collection) DataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.static reactor.core.publisher.Mono<DataBuffer>
DataBufferUtils.join
(Publisher<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of joining together the givendataBuffers
elements.static reactor.core.publisher.Mono<DataBuffer>
DataBufferUtils.join
(Publisher<? extends DataBuffer> buffers, int maxByteCount) Variant ofDataBufferUtils.join(Publisher)
that behaves the same way up until the specified max number of bytes to buffer.DefaultDataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.Netty5DataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.NettyDataBufferFactory.join
(List<? extends DataBuffer> dataBuffers) Return a newDataBuffer
composed of thedataBuffers
elements joined together.boolean
LimitedDataBufferList.removeIf
(Predicate<? super DataBuffer> filter) static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<? extends DataBuffer> source, AsynchronousFileChannel channel, long position) Write the given stream ofDataBuffers
to the givenAsynchronousFileChannel
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, OutputStream outputStream) Write the given stream ofDataBuffers
to the givenOutputStream
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, AsynchronousFileChannel channel) Write the given stream ofDataBuffers
to the givenAsynchronousFileChannel
.static reactor.core.publisher.Flux<DataBuffer>
DataBufferUtils.write
(Publisher<DataBuffer> source, WritableByteChannel channel) Write the given stream ofDataBuffers
to the givenWritableByteChannel
.static reactor.core.publisher.Mono<Void>
DataBufferUtils.write
(Publisher<DataBuffer> source, Path destination, OpenOption... options) Write the given stream ofDataBuffers
to the given filePath
.ModifierConstructorDescriptionDataBufferWrapper
(DataBuffer delegate) Create a newDataBufferWrapper
that wraps the given buffer.
Decoder.decode(DataBuffer, ResolvableType, MimeType, Map)
instead