Class ByteArraySerializer

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

    public class ByteArraySerializer
    extends Object
    implements com.google.gson.JsonSerializer<byte[]>, com.google.gson.JsonDeserializer<byte[]>
    The type Byte array serializer.
    • Constructor Detail

      • ByteArraySerializer

        public ByteArraySerializer()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(byte[] data,
                                                     Type type,
                                                     com.google.gson.JsonSerializationContext jsonSerializationContext)
        ByteArray serialize
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<byte[]>
        Parameters:
        data - byte[]
        type - Type
        jsonSerializationContext - JsonSerializationContext
        Returns:
        JsonElement
      • deserialize

        public byte[] deserialize​(com.google.gson.JsonElement jsonElement,
                                  Type type,
                                  com.google.gson.JsonDeserializationContext jsonDeserializationContext)
        ByteArray deserialize
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<byte[]>
        Parameters:
        jsonElement - JsonElement
        type - Type
        jsonDeserializationContext - JsonDeserializationContext
        Returns:
        byte[]