com.adyen.serializer.ByteArrayDeserializer Maven / Gradle / Ivy
package com.adyen.serializer;
import com.fasterxml.jackson.core.JacksonException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class ByteArrayDeserializer extends StdDeserializer {
public ByteArrayDeserializer() {
super(byte[].class);
}
@Override
public byte[] deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException {
return jsonParser.getValueAsString().getBytes(StandardCharsets.UTF_8);
}
}