## 接口的使用
org.springframework.core.io.buffer.DataBufferFactory

- 使用DataBufferFactory的程序包
  程序包 | 说明
  --- | ---
  org.springframework.core.codec | `Encoder` and `Decoder` abstractions to convert between a reactive stream of bytes and Java objects.
  org.springframework.core.io.buffer | Generic abstraction for working with byte buffer implementations.

- - ### org.springframework.core.codec中DataBufferFactory的使用

    参数类型为DataBufferFactory的org.springframework.core.codec中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `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> inputStream, 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 dataBufferFactory, 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.

  - ### org.springframework.core.io.buffer中DataBufferFactory的使用

    实现DataBufferFactory的org.springframework.core.io.buffer中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `DefaultDataBufferFactory` Default implementation of the `DataBufferFactory` interface.
    `class` | `NettyDataBufferFactory` Implementation of the `DataBufferFactory` interface based on a Netty `ByteBufAllocator`.

    返回DataBufferFactory的org.springframework.core.io.buffer中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `DataBufferFactory` | DataBuffer.`factory()` Return the `DataBufferFactory` that created this buffer.

    参数类型为DataBufferFactory的org.springframework.core.io.buffer中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`read(AsynchronousFileChannel channel, DataBufferFactory dataBufferFactory, int bufferSize)` 已过时。 as of Spring 5.0.3, in favor of `DataBufferUtils.readAsynchronousFileChannel(Callable, DataBufferFactory, int)`, to be removed in Spring 5.1
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`read(AsynchronousFileChannel channel, long position, DataBufferFactory dataBufferFactory, int bufferSize)` 已过时。 as of Spring 5.0.3, in favor of `DataBufferUtils.readAsynchronousFileChannel(Callable, long, DataBufferFactory, int)`, to be removed in Spring 5.1
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`read(InputStream inputStream, DataBufferFactory dataBufferFactory, int bufferSize)` 已过时。 as of Spring 5.0.3, in favor of `DataBufferUtils.readInputStream(Callable, DataBufferFactory, int)`, to be removed in Spring 5.1
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`read(ReadableByteChannel channel, DataBufferFactory dataBufferFactory, int bufferSize)` 已过时。 as of Spring 5.0.3, in favor of `DataBufferUtils.readByteChannel(Callable, DataBufferFactory, int)`, to be removed in Spring 5.1
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`read(Resource resource, DataBufferFactory dataBufferFactory, 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 dataBufferFactory, 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 dataBufferFactory, 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 dataBufferFactory, 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 dataBufferFactory, int bufferSize)` Obtain a `ReadableByteChannel` from the given supplier, and read it into a `Flux` of `DataBuffer`s.
    `static reactor.core.publisher.Flux<DataBuffer>` | DataBufferUtils.`readInputStream(Callable<InputStream> inputStreamSupplier, DataBufferFactory dataBufferFactory, int bufferSize)` Obtain a `InputStream` from the given supplier, and read it into a `Flux` of `DataBuffer`s.