org.springframework.core.codec

## 类 ByteBufferEncoder

- java.lang.Object
- - org.springframework.core.codec.AbstractEncoder<ByteBuffer>
  - - org.springframework.core.codec.ByteBufferEncoder

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

      public class ByteBufferEncoder
      extends AbstractEncoder<ByteBuffer>

  Encoder for `ByteBuffer`s.
  从以下版本开始:
    5.0
  作者:
    Sebastien Deleuze

- - ### 构造器概要

    构造器
    构造器和说明
    `ByteBufferEncoder()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `canEncode(ResolvableType elementType, MimeType mimeType)` Whether the encoder supports the given source element type and the MIME type for the output stream.
    `reactor.core.publisher.Flux<DataBuffer>` | `encode(org.reactivestreams.Publisher<? extends ByteBuffer> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)` Encode a stream of Objects of type `T` into a `DataBuffer` output stream.

    - ### 从类继承的方法 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`

- - ### 构造器详细资料

    - #### ByteBufferEncoder

          public ByteBufferEncoder()

  - ### 方法详细资料

    - #### 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<ByteBuffer>`
      覆盖:
        `canEncode` 在类中 `AbstractEncoder<ByteBuffer>`
      参数:
        `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

          public reactor.core.publisher.Flux<DataBuffer> encode(org.reactivestreams.Publisher<? extends ByteBuffer> inputStream,
                                                                DataBufferFactory bufferFactory,
                                                                ResolvableType elementType,
                                                                @Nullable
                                                                MimeType mimeType,
                                                                @Nullable
                                                                Map<String,Object> hints)

      从接口复制的说明: `Encoder`
      Encode a stream of Objects of type `T` into a `DataBuffer` output stream.
      参数:
        `inputStream` - the input stream of Objects to encode. If the input should be encoded as a single value rather than as a stream of elements, an instance of `Mono` should be used.
        `bufferFactory` - for creating output stream `DataBuffer`'s
        `elementType` - the expected type of elements in the input stream; this type must have been previously passed to the `Encoder.canEncode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)` method and it must have returned `true`.
        `mimeType` - the MIME type for the output stream (optional)
        `hints` - additional information about how to do encode
      返回:
        the output stream