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

com.geotab.model.serialization.ByteArrayDeserializer Maven / Gradle / Ivy

/*
 *
 * 2020 Copyright (C) Geotab Inc. All rights reserved.
 */

package com.geotab.model.serialization;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;
import org.apache.commons.lang3.ArrayUtils;

public class ByteArrayDeserializer extends JsonDeserializer {

  @Override
  public Byte[] deserialize(JsonParser jsonParser, DeserializationContext context)
      throws IOException {
    return ArrayUtils.toObject(jsonParser.getText().getBytes());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy