Class ByteArrayJsonAdapter
java.lang.Object
org.eclipse.keyple.core.util.json.ByteArrayJsonAdapter
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<byte[]>
,com.google.gson.JsonSerializer<byte[]>
public class ByteArrayJsonAdapter
extends 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
deserialize
(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) com.google.gson.JsonElement
-
Constructor Details
-
ByteArrayJsonAdapter
public ByteArrayJsonAdapter()
-
-
Method Details
-
serialize
public com.google.gson.JsonElement serialize(byte[] data, Type typeOfSrc, com.google.gson.JsonSerializationContext context) - Specified by:
serialize
in interfacecom.google.gson.JsonSerializer<byte[]>
- Since:
- 2.0.0
-
deserialize
public byte[] deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException - Specified by:
deserialize
in interfacecom.google.gson.JsonDeserializer<byte[]>
- Throws:
com.google.gson.JsonParseException
- Since:
- 2.0.0
-