All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adyen.serializer.ByteArraySerializer Maven / Gradle / Ivy

There is a newer version: 38.1.0
Show newest version
package com.adyen.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;

public class ByteArraySerializer extends StdSerializer {
    public ByteArraySerializer() {
        super(byte[].class);
    }

    @Override
    public void serialize(byte[] bytes, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        String yourReadableString = new String(bytes);
        jsonGenerator.writeString(yourReadableString);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy