Interface SerializationContext

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, java.io.Flushable

    public interface SerializationContext
    extends java.io.Closeable, java.io.Flushable
    Bundles state and configuration for serialization. Must be recreated for each serialization target.

    This is a Ditto internal class which is not intended for re-use. It therefore is not treated as API which is held binary compatible to previous versions.

    Since:
    1.2.1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void writeBoolean​(boolean state)
      Writes the passed boolean state to the serialization context.
      void writeCachedElement​(byte[] cachedData)
      Allows the caller to directly embed cached data in the Buffer.
      void writeFieldName​(java.lang.String name)
      Writes the passed string name (as field name) to the serialization context.
      void writeNull()
      Writes null to the serialization context.
      void writeNumber​(double number)
      Writes the passed double number to the serialization context.
      void writeNumber​(float number)
      Writes the passed float number to the serialization context.
      void writeNumber​(int number)
      Writes the passed long number to the serialization context.
      void writeNumber​(long number)
      Writes the passed long number to the serialization context.
      void writeString​(java.lang.String text)
      Writes the passed string text to the serialization context.
      • Methods inherited from interface java.io.Closeable

        close
      • Methods inherited from interface java.io.Flushable

        flush
    • Method Detail

      • writeCachedElement

        void writeCachedElement​(byte[] cachedData)
                         throws java.io.IOException
        Allows the caller to directly embed cached data in the Buffer. This can only be used to write exactly one element.
        Parameters:
        cachedData - The data to write in an appropriately sized array.
        Throws:
        java.io.IOException
      • writeNull

        void writeNull()
                throws java.io.IOException
        Writes null to the serialization context.
        Throws:
        java.io.IOException
      • writeBoolean

        void writeBoolean​(boolean state)
                   throws java.io.IOException
        Writes the passed boolean state to the serialization context.
        Throws:
        java.io.IOException
      • writeNumber

        void writeNumber​(float number)
                  throws java.io.IOException
        Writes the passed float number to the serialization context.
        Throws:
        java.io.IOException
      • writeNumber

        void writeNumber​(double number)
                  throws java.io.IOException
        Writes the passed double number to the serialization context.
        Throws:
        java.io.IOException
      • writeNumber

        void writeNumber​(long number)
                  throws java.io.IOException
        Writes the passed long number to the serialization context.
        Throws:
        java.io.IOException
      • writeNumber

        void writeNumber​(int number)
                  throws java.io.IOException
        Writes the passed long number to the serialization context.
        Throws:
        java.io.IOException
      • writeString

        void writeString​(java.lang.String text)
                  throws java.io.IOException
        Writes the passed string text to the serialization context.
        Throws:
        java.io.IOException
      • writeFieldName

        void writeFieldName​(java.lang.String name)
                     throws java.io.IOException
        Writes the passed string name (as field name) to the serialization context.
        Throws:
        java.io.IOException