- java.lang.Object
-
- de.haumacher.msgbuf.json.JsonUtil
-
public class JsonUtil extends Object
Utilities for reading and writing JSON.- Author:
- Bernhard Haumacher
-
-
Constructor Summary
Constructors Constructor Description JsonUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]nextBinaryOptional(JsonReader in)Reads a byte array or anullvalue from the given reader.static StringnextStringOptional(JsonReader in)Reads a string or anullvalue from the given reader.static voidwriteBinaryOptional(JsonWriter out, byte[] value)Writes the given byte array as Base64 encoded string.
-
-
-
Method Detail
-
nextStringOptional
public static String nextStringOptional(JsonReader in) throws IOException
Reads a string or anullvalue from the given reader.- Throws:
IOException
-
nextBinaryOptional
public static byte[] nextBinaryOptional(JsonReader in) throws IOException
Reads a byte array or anullvalue from the given reader.- Throws:
IOException
-
writeBinaryOptional
public static void writeBinaryOptional(JsonWriter out, byte[] value) throws IOException
Writes the given byte array as Base64 encoded string.- Throws:
IOException
-
-