Class JsonWriter

    • Method Detail

      • writeStartArray

        public JsonWriter writeStartArray()
      • writeEndArray

        public JsonWriter writeEndArray()
      • writeStartObject

        public JsonWriter writeStartObject()
      • writeEndObject

        public JsonWriter writeEndObject()
      • writeValue

        public JsonWriter writeValue​(boolean bool)
      • writeValue

        public JsonWriter writeValue​(long val)
      • writeValue

        public JsonWriter writeValue​(double val)
      • writeValue

        public JsonWriter writeValue​(float val)
      • writeValue

        public JsonWriter writeValue​(short val)
      • writeValue

        public JsonWriter writeValue​(int val)
      • close

        public void close()
        Closes the generator and flushes to write. Must be called when finished writing JSON content.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface SdkAutoCloseable
      • getBytes

        public byte[] getBytes()
        Get the JSON content as a UTF-8 encoded byte array. It is recommended to hold onto the array reference rather then making repeated calls to this method as a new array will be created each time.
        Returns:
        Array of UTF-8 encoded bytes that make up the generated JSON.