Class JsonUtil

java.lang.Object
de.haumacher.msgbuf.json.JsonUtil

public class JsonUtil extends Object
Utilities for reading and writing JSON.
Author:
Bernhard Haumacher
  • Constructor Details

    • JsonUtil

      public JsonUtil()
  • Method Details

    • nextStringOptional

      public static String nextStringOptional(JsonReader in) throws IOException
      Reads a string or a null value from the given reader.
      Throws:
      IOException
    • nextBinaryOptional

      public static byte[] nextBinaryOptional(JsonReader in) throws IOException
      Reads a byte array or a null value 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