Interface WritableValue

    • Method Detail

      • writeBoolean

        void writeBoolean​(boolean value)
      • writeChar

        void writeChar​(char value)
      • writeInt

        void writeInt​(int value)
      • writeLong

        void writeLong​(long value)
      • writeFloat

        void writeFloat​(float value)
      • writeDouble

        void writeDouble​(double value)
      • writeString

        void writeString​(java.lang.CharSequence value)
      • setArrayLength

        void setArrayLength​(int len)
        Set length of the array. It must be called prior to nextWritableElement
        Parameters:
        len - length of the array
      • nextWritableElement

        WritableValue nextWritableElement()

        Returns a transient (reused by interface implementation) WritableValue object for the next element of the array.

        setArrayLength(int) method must be called before this method.
        Client code must not cache the reference for further usage.
        Usage sample:

          encoder.setArrayLength(10);
          for(int i=0; i<10; i++) {
              WritableValue v = encoder.nextWritableElement (i);
              v.setInt(i);
          }
         
        Returns:
        reference to WritableValue object
        Throws:
        java.util.NoSuchElementException - when when the next element lays beyond array boundary
      • writeBinary

        void writeBinary​(byte[] data,
                         int offset,
                         int length)
      • writeNull

        void writeNull()