org.springframework.core.codec

Class ResourceEncoder

    • Field Detail

      • DEFAULT_BUFFER_SIZE

        public static final int DEFAULT_BUFFER_SIZE
        The default buffer size used by the encoder.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceEncoder

        public ResourceEncoder()
      • ResourceEncoder

        public ResourceEncoder(int bufferSize)
    • Method Detail

      • canEncode

        public boolean canEncode(ResolvableType elementType,
                                 @Nullable
                                 MimeType mimeType)
        Description copied from interface: Encoder
        Whether the encoder supports the given source element type and the MIME type for the output stream.
        Specified by:
        canEncode in interface Encoder<Resource>
        Overrides:
        canEncode in class AbstractEncoder<Resource>
        Parameters:
        elementType - the type of elements in the source stream
        mimeType - the MIME type for the output stream (can be null if not specified)
        Returns:
        true if supported, false otherwise