org.springframework.core.codec

## 类 ResourceEncoder

- java.lang.Object
- - org.springframework.core.codec.AbstractEncoder<T>
  - - org.springframework.core.codec.AbstractSingleValueEncoder<Resource>
    - - org.springframework.core.codec.ResourceEncoder

- 所有已实现的接口:
    Encoder<Resource>

      public class ResourceEncoder
      extends AbstractSingleValueEncoder<Resource>

  Encoder for `Resource`s.
  从以下版本开始:
    5.0
  作者:
    Arjen Poutsma

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static int` | `DEFAULT_BUFFER_SIZE`

  - ### 构造器概要

    构造器
    构造器和说明
    `ResourceEncoder()`
    `ResourceEncoder(int bufferSize)`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `canEncode(ResolvableType elementType, MimeType mimeType)` Whether the encoder supports the given source element type and the MIME type for the output stream.
    `protected reactor.core.publisher.Flux<DataBuffer>` | `encode(Resource resource, DataBufferFactory dataBufferFactory, ResolvableType type, MimeType mimeType, Map<String,Object> hints)` Encode `T` to an output `DataBuffer` stream.

    - ### 从类继承的方法 org.springframework.core.codec.AbstractSingleValueEncoder

      `encode`

    - ### 从类继承的方法 org.springframework.core.codec.AbstractEncoder

      `getEncodableMimeTypes`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.core.codec.Encoder

      `getContentLength`

- - ### 字段详细资料

    - #### DEFAULT_BUFFER_SIZE

          public static final int DEFAULT_BUFFER_SIZE

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### ResourceEncoder

          public ResourceEncoder()

    - #### ResourceEncoder

          public ResourceEncoder(int bufferSize)

  - ### 方法详细资料

    - #### canEncode

          public boolean canEncode(ResolvableType elementType,
                                   @Nullable
                                   MimeType mimeType)

      从接口复制的说明: `Encoder`
      Whether the encoder supports the given source element type and the MIME type for the output stream.
      指定者:
        `canEncode` 在接口中 `Encoder<Resource>`
      覆盖:
        `canEncode` 在类中 `AbstractEncoder<Resource>`
      参数:
        `elementType` - the type of elements in the source stream
        `mimeType` - the MIME type for the output stream (can be `null` if not specified)
      返回:
        `true` if supported, `false` otherwise

    - #### encode

          protected reactor.core.publisher.Flux<DataBuffer> encode(Resource resource,
                                                                   DataBufferFactory dataBufferFactory,
                                                                   ResolvableType type,
                                                                   @Nullable
                                                                   MimeType mimeType,
                                                                   @Nullable
                                                                   Map<String,Object> hints)

      从类复制的说明: `AbstractSingleValueEncoder`
      Encode `T` to an output `DataBuffer` stream.
      指定者:
        `encode` 在类中 `AbstractSingleValueEncoder<Resource>`
      参数:
        `resource` - the value to process
        `dataBufferFactory` - a buffer factory used to create the output
        `type` - the stream element type to process
        `mimeType` - the mime type to process
        `hints` - Additional information about how to do decode, optional
      返回:
        the output stream