接口的使用
cn.taketoday.core.io.buffer.DataBuffer
使用DataBuffer的程序包
程序包
说明
Generic abstraction for working with byte buffer implementations.
-
cn.taketoday.core.codec中DataBuffer的使用
修饰符和类型方法说明DataBufferDecoder.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 DataBufferEncoder.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.api.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) 返回变量类型为DataBuffer的类型的cn.taketoday.core.codec中的方法修饰符和类型方法说明reactor.core.publisher.Flux<DataBuffer>DataBufferDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) final reactor.core.publisher.Flux<DataBuffer>AbstractSingleValueEncoder.encode(org.reactivestreams.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) EncodeTto an outputDataBufferstream.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>Encoder.encode(org.reactivestreams.Publisher<? extends T> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Encode a stream of Objects of typeTinto aDataBufferoutput stream.reactor.core.publisher.Flux<DataBuffer>Netty5BufferEncoder.encode(org.reactivestreams.Publisher<? extends io.netty5.buffer.api.Buffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<DataBuffer>NettyByteBufEncoder.encode(org.reactivestreams.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(org.reactivestreams.Publisher<? extends ResourceRegion> input, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) 参数类型为DataBuffer的cn.taketoday.core.codec中的方法修饰符和类型方法说明byte[]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 TDecoder.decode(DataBuffer buffer, ResolvableType targetType, MimeType mimeType, Map<String, Object> hints) Decode a data buffer to an Object of type T.io.netty5.buffer.api.BufferNetty5BufferDecoder.decode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) io.netty.buffer.ByteBufNettyByteBufDecoder.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) DataBufferEncoder.encodeValue(DataBuffer buffer, DataBufferFactory bufferFactory, ResolvableType valueType, MimeType mimeType, Map<String, Object> hints) static voidHints.touchDataBuffer(DataBuffer buffer, Map<String, Object> hints, Logger logger) If the hints contain aHints.LOG_PREFIX_HINTand the given logger has DEBUG level enabled, apply the log prefix as a hint to the given buffer viaDataBufferUtils.touch(DataBuffer, Object).类型变量类型为DataBuffer的cn.taketoday.core.codec中的方法参数修饰符和类型方法说明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.Flux<T>Decoder.decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) Decode aDataBufferinput stream into a Flux ofT.reactor.core.publisher.Flux<Resource>ResourceDecoder.decode(org.reactivestreams.Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Flux<String>StringDecoder.decode(org.reactivestreams.Publisher<DataBuffer> input, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<T>AbstractDataBufferDecoder.decodeToMono(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 aDataBufferinput stream into a Mono ofT.reactor.core.publisher.Flux<DataBuffer>DataBufferEncoder.encode(org.reactivestreams.Publisher<? extends DataBuffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String, Object> hints) -
cn.taketoday.core.io.buffer中DataBuffer的使用
修饰符和类型接口说明interfaceExtension ofDataBufferthat allows for buffers that can be used in atry-with-resources statement.interfaceExtension ofDataBufferthat allows for buffers that share a memory pool.interfaceExtension ofDataBufferthat allows for buffers that can be given hints for debugging purposes.修饰符和类型类说明classProvides a convenient implementation of theDataBufferinterface that can be overridden to adapt the delegate.classDefault implementation of theDataBufferinterface that uses aByteBufferinternally. with separate read and write positions.final classImplementation of theDataBufferinterface that wraps a Netty 5Buffer.classImplementation of theDataBufferinterface that wraps a NettyByteBuf.类型参数类型为DataBuffer的cn.taketoday.core.io.buffer中的方法修饰符和类型方法说明static <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(org.reactivestreams.Publisher<T> publisher, long maxByteCount) Skip buffers from the givenPublisheruntil 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(org.reactivestreams.Publisher<T> publisher, long maxByteCount) Relay buffers from the givenPublisheruntil 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.修饰符和类型方法说明DataBufferFactory.allocateBuffer()Allocate a data buffer of a default initial capacity.DataBufferFactory.allocateBuffer(int initialCapacity) Allocate a data buffer of the given initial capacity.DataBuffer.capacity(int capacity) 已过时。DataBufferWrapper.capacity(int capacity) 已过时。DefaultDataBuffer.capacity(int capacity) DataBufferWrapper.dataBuffer()Return the wrapped delegate.default DataBufferDataBuffer.ensureCapacity(int capacity) 已过时。in favor ofensureWritable(int)DataBufferWrapper.ensureCapacity(int capacity) 已过时。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 newDataBuffercomposed of thedataBufferselements joined together.Netty5DataBufferFactory.join(List<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of thedataBufferselements joined together.NettyDataBufferFactory.join(List<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of thedataBufferselements 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 mostlengthbytes 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 DataBufferDataBuffer.retainedSlice(int index, int length) 已过时。in favor ofsplit(int), which has different semanticsDataBufferWrapper.retainedSlice(int index, int length) 已过时。LimitedDataBufferList.set(int index, DataBuffer element) DataBuffer.slice(int index, int length) 已过时。in favor ofsplit(int), which has different semanticsDataBufferWrapper.slice(int index, int length) 已过时。Netty5DataBuffer.slice(int index, int length) 已过时。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 givenbytearray in aDataBuffer.DataBufferFactory.wrap(ByteBuffer byteBuffer) Wrap the givenByteBufferin 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 mostlengthbytes of the given source into this buffer, starting at the current writing position of this buffer.DataBuffer.write(DataBuffer... buffers) Write one or moreDataBuffers to this buffer, starting at the current writing position.default DataBufferDataBuffer.write(CharSequence charSequence, Charset charset) Write the givenCharSequenceusing the givenCharset, starting at the current writing position.DataBuffer.write(ByteBuffer... buffers) Write one or moreByteBufferto 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(DataBuffer... buffers) DataBufferWrapper.write(CharSequence charSequence, Charset charset) DataBufferWrapper.write(ByteBuffer... 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) 返回变量类型为DataBuffer的类型的cn.taketoday.core.io.buffer中的方法修饰符和类型方法说明static reactor.core.publisher.Mono<DataBuffer>DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of joining together the givendataBufferselements.static reactor.core.publisher.Mono<DataBuffer>DataBufferUtils.join(org.reactivestreams.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(Resource resource, long position, DataBufferFactory bufferFactory, int bufferSize) Read the givenResourceinto aFluxofDataBuffers starting at the given position.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.read(Resource resource, DataBufferFactory bufferFactory, int bufferSize) Read the givenResourceinto aFluxofDataBuffers.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.read(Path path, DataBufferFactory bufferFactory, int bufferSize, OpenOption... options) Read bytes from the given filePathinto aFluxofDataBuffers.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.readAsynchronousFileChannel(Callable<AsynchronousFileChannel> channelSupplier, long position, DataBufferFactory bufferFactory, int bufferSize) Obtain anAsynchronousFileChannelfrom the given supplier, and read it into aFluxofDataBuffers, starting at the given position.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.readAsynchronousFileChannel(Callable<AsynchronousFileChannel> channelSupplier, DataBufferFactory bufferFactory, int bufferSize) Obtain aAsynchronousFileChannelfrom the given supplier, and read it into aFluxofDataBuffers.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(org.reactivestreams.Publisher<? extends DataBuffer> source, AsynchronousFileChannel channel, long position) Write the given stream ofDataBuffersto the givenAsynchronousFileChannel.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, OutputStream outputStream) Write the given stream ofDataBuffersto the givenOutputStream.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, AsynchronousFileChannel channel) Write the given stream ofDataBuffersto the givenAsynchronousFileChannel.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, WritableByteChannel channel) Write the given stream ofDataBuffersto the givenWritableByteChannel.参数类型为DataBuffer的cn.taketoday.core.io.buffer中的方法修饰符和类型方法说明voidLimitedDataBufferList.add(int index, DataBuffer buffer) booleanLimitedDataBufferList.add(DataBuffer buffer) intDataBufferUtils.Matcher.match(DataBuffer dataBuffer) Find the first matching delimiter and return the index of the last byte of the delimiter, or-1if not found.static booleanDataBufferUtils.release(DataBuffer dataBuffer) Release the given data buffer.LimitedDataBufferList.set(int index, DataBuffer element) static io.netty5.buffer.api.BufferNetty5DataBufferFactory.toBuffer(DataBuffer buffer) Return the given NettyDataBufferas aBuffer.static io.netty.buffer.ByteBufNettyDataBufferFactory.toByteBuf(DataBuffer buffer) Return the given NettyDataBufferas aByteBuf.DataBuffer.write(DataBuffer... buffers) Write one or moreDataBuffers to this buffer, starting at the current writing position.DataBufferWrapper.write(DataBuffer... buffers) DefaultDataBuffer.write(DataBuffer... buffers) Netty5DataBuffer.write(DataBuffer... buffers) NettyDataBuffer.write(DataBuffer... buffers) 类型变量类型为DataBuffer的cn.taketoday.core.io.buffer中的方法参数修饰符和类型方法说明booleanLimitedDataBufferList.addAll(int index, Collection<? extends DataBuffer> collection) booleanLimitedDataBufferList.addAll(Collection<? extends DataBuffer> collection) DataBufferFactory.join(List<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of thedataBufferselements joined together.static reactor.core.publisher.Mono<DataBuffer>DataBufferUtils.join(org.reactivestreams.Publisher<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of joining together the givendataBufferselements.static reactor.core.publisher.Mono<DataBuffer>DataBufferUtils.join(org.reactivestreams.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 newDataBuffercomposed of thedataBufferselements joined together.Netty5DataBufferFactory.join(List<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of thedataBufferselements joined together.NettyDataBufferFactory.join(List<? extends DataBuffer> dataBuffers) Return a newDataBuffercomposed of thedataBufferselements joined together.booleanLimitedDataBufferList.removeIf(Predicate<? super DataBuffer> filter) static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<? extends DataBuffer> source, AsynchronousFileChannel channel, long position) Write the given stream ofDataBuffersto the givenAsynchronousFileChannel.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, OutputStream outputStream) Write the given stream ofDataBuffersto the givenOutputStream.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, AsynchronousFileChannel channel) Write the given stream ofDataBuffersto the givenAsynchronousFileChannel.static reactor.core.publisher.Flux<DataBuffer>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, WritableByteChannel channel) Write the given stream ofDataBuffersto the givenWritableByteChannel.static reactor.core.publisher.Mono<Void>DataBufferUtils.write(org.reactivestreams.Publisher<DataBuffer> source, Path destination, OpenOption... options) Write the given stream ofDataBuffersto the given filePath.参数类型为DataBuffer的cn.taketoday.core.io.buffer中的构造器限定符构造器说明DataBufferWrapper(DataBuffer delegate) Create a newDataBufferWrapperthat wraps the given buffer.
ensureWritable(int), which has different semantics