Interface SerializationContext

All Superinterfaces:
AutoCloseable, Closeable, Flushable

public interface SerializationContext extends Closeable, 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

    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
    Writes the passed string name (as field name) to the serialization context.
    void
    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
    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 Details

    • writeCachedElement

      void writeCachedElement(byte[] cachedData) throws 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:
      IOException
    • writeNull

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

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

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

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

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

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

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

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