Interface DataWriter

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void beginArray​(DataType type, int lenght)
      Starts writing an array value with entries of the given type.
      void beginObject()
      Starts writing an object.
      void endArray()
      Stops writing the array started with the last call to beginObject().
      void endObject()
      Finishes writing the fields of the object started with the last call to beginObject().
      void name​(int id)
      Writes an identifier of a field fo the currently written object.
      default void value​(boolean value)
      Writes a boolean value.
      void value​(byte[] value)
      Writes a binary string value.
      void value​(double value)
      Writes a double value.
      void value​(float value)
      Writes a float value.
      void value​(int value)
      Writes an unsigned int value.
      void value​(long value)
      Writes an unsigned long value.
      void value​(String value)
      Writes a String value in utf-8 encoding.
      OutputStream valueBinaryStream()
      Starts writing a binary value of arbitrary length in chunked mode.
      void valueFixed​(int value)
      Writes a fixed size 32 bit int value.
      void valueFixed​(long value)
      Writes a fixed size 64 bit long value.
      void valueSigned​(int value)
      Writes a signed int value.
      void valueSigned​(long value)
      Writes a signed long value.
    • Method Detail

      • beginObject

        void beginObject()
                  throws IOException
        Starts writing an object.

        A sequence of interleaving calls to name(int) and a value encoding method such as value(int) is expected followed by a final endObject() call.

        Throws:
        IOException - If writing fails.
      • endObject

        void endObject()
                throws IOException
        Finishes writing the fields of the object started with the last call to beginObject().
        Throws:
        IOException - If writing fails.
      • name

        void name​(int id)
           throws IOException
        Writes an identifier of a field fo the currently written object.
        Throws:
        IOException - If writing fails.
      • value

        default void value​(boolean value)
                    throws IOException
        Writes a boolean value.
        Throws:
        IOException - If writing fails.
      • value

        void value​(int value)
            throws IOException
        Writes an unsigned int value.
        Throws:
        IOException - If writing fails.
      • valueSigned

        void valueSigned​(int value)
                  throws IOException
        Writes a signed int value.
        Throws:
        IOException - If writing fails.
      • valueFixed

        void valueFixed​(int value)
                 throws IOException
        Writes a fixed size 32 bit int value.
        Throws:
        IOException - If writing fails.
      • value

        void value​(long value)
            throws IOException
        Writes an unsigned long value.
        Throws:
        IOException - If writing fails.
      • valueSigned

        void valueSigned​(long value)
                  throws IOException
        Writes a signed long value.
        Throws:
        IOException - If writing fails.
      • valueFixed

        void valueFixed​(long value)
                 throws IOException
        Writes a fixed size 64 bit long value.
        Throws:
        IOException - If writing fails.
      • value

        void value​(float value)
            throws IOException
        Writes a float value.
        Throws:
        IOException - If writing fails.
      • value

        void value​(double value)
            throws IOException
        Writes a double value.
        Throws:
        IOException - If writing fails.
      • value

        void value​(byte[] value)
            throws IOException
        Writes a binary string value.
        Throws:
        IOException - If writing fails.
      • beginArray

        void beginArray​(DataType type,
                        int lenght)
                 throws IOException
        Starts writing an array value with entries of the given type.
        Parameters:
        type - The type of the array elements.
        lenght - The number of elements that follow.
        Throws:
        IOException - If writing fails.