Class ByteArrayJsonAdapter

  • All Implemented Interfaces:
    com.google.gson.JsonDeserializer<byte[]>, com.google.gson.JsonSerializer<byte[]>

    public class ByteArrayJsonAdapter
    extends java.lang.Object
    implements com.google.gson.JsonSerializer<byte[]>, com.google.gson.JsonDeserializer<byte[]>
    JSON serializer/deserializer of a byte array to a hex string.
    Since:
    2.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] deserialize​(com.google.gson.JsonElement json, java.lang.reflect.Type typeOfT, com.google.gson.JsonDeserializationContext context)
      com.google.gson.JsonElement serialize​(byte[] data, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteArrayJsonAdapter

        public ByteArrayJsonAdapter()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(byte[] data,
                                                     java.lang.reflect.Type typeOfSrc,
                                                     com.google.gson.JsonSerializationContext context)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<byte[]>
        Since:
        2.0.0
      • deserialize

        public byte[] deserialize​(com.google.gson.JsonElement json,
                                  java.lang.reflect.Type typeOfT,
                                  com.google.gson.JsonDeserializationContext context)
                           throws com.google.gson.JsonParseException
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<byte[]>
        Throws:
        com.google.gson.JsonParseException
        Since:
        2.0.0