Package org.springframework.http.codec.json

# Class Jackson2SmileEncoder

java.lang.Object
org.springframework.http.codec.json.Jackson2CodecSupport
org.springframework.http.codec.json.AbstractJackson2Encoder
org.springframework.http.codec.json.Jackson2SmileEncoder

All Implemented Interfaces:
  `org.springframework.core.codec.Encoder<Object>`, `HttpMessageEncoder<Object>`

public class Jackson2SmileEncoder extends AbstractJackson2Encoder
Encode from an `Object` stream to a byte stream of Smile objects using Jackson 2.x. For non-streaming use cases, `Flux` elements are collected into a `List` before serialization for performance reason.

Since:
  5.0
Author:
  Sebastien Deleuze
See Also:
  - `Jackson2SmileDecoder`

## Field Summary

### Fields inherited from class org.springframework.http.codec.json.Jackson2CodecSupport

`JSON_VIEW_HINT, logger`

## Constructor Summary

Constructors
Constructor
Description
`Jackson2SmileEncoder()`
`Jackson2SmileEncoder(ObjectMapper mapper, org.springframework.util.MimeType... mimeTypes)`

## Method Summary

Modifier and Type
Method
Description
`protected byte[]`
`getStreamingMediaTypeSeparator(org.springframework.util.MimeType mimeType)`
Return the separator to use for the given mime type.

### Methods inherited from class org.springframework.http.codec.json.AbstractJackson2Encoder

`canEncode, customizeWriter, encode, encodeValue, getAnnotation, getEncodableMimeTypes, getEncodableMimeTypes, getEncodeHints, getJsonEncoding, getStreamingMediaTypes, setStreamingMediaTypes`

### Methods inherited from class org.springframework.http.codec.json.Jackson2CodecSupport

`getHints, getJavaType, getMediaTypesForProblemDetail, getMimeTypes, getMimeTypes, getObjectMapper, getObjectMapperRegistrations, getObjectMappersForType, getParameter, logWarningIfNecessary, registerObjectMappersForType, selectObjectMapper, setObjectMapper, supportsMimeType`

### Methods inherited from class java.lang.Object

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

## Constructor Details

### Jackson2SmileEncoder

public Jackson2SmileEncoder()

### Jackson2SmileEncoder

public Jackson2SmileEncoder(ObjectMapper mapper, org.springframework.util.MimeType... mimeTypes)

## Method Details

### getStreamingMediaTypeSeparator

@Nullable protected byte[] getStreamingMediaTypeSeparator(@Nullable org.springframework.util.MimeType mimeType)
Return the separator to use for the given mime type.

By default, this method returns a single byte 0 if the given mime type is one of the configured `streaming` mime types.

Overrides:
  `getStreamingMediaTypeSeparator` in class `AbstractJackson2Encoder`
Since:
  5.3