spring-framework / org.springframework.http.converter.json / GsonBuilderUtils / gsonBuilderWithBase64EncodedByteArrays

gsonBuilderWithBase64EncodedByteArrays

open static fun gsonBuilderWithBase64EncodedByteArrays(): GsonBuilder

Obtain a GsonBuilder which Base64-encodes byte[] properties when reading and writing JSON.

A custom com.google.gson.TypeAdapter will be registered via GsonBuilder#registerTypeHierarchyAdapter(Class, Object) which serializes a byte[] property to and from a Base64-encoded String instead of a JSON array.