io.vertx.core.shareddata

## Interface ClusterSerializable

- All Superinterfaces:
    io.vertx.core.shareddata.impl.ClusterSerializable
  All Known Subinterfaces:
    Buffer

      public interface ClusterSerializable
      extends io.vertx.core.shareddata.impl.ClusterSerializable

  Objects implementing this interface will be written to and read from a `Buffer` when:
  - stored in and read from an `AsyncMap`, or
  - encodec to and decoded from an `EventBus` message body

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `readFromBuffer(int pos, Buffer buffer)` Method invoked when deserializing bytes to this instance.
    `void` | `writeToBuffer(Buffer buffer)` Method invoked when serializing this instance.

- - ### Method Detail

    - #### writeToBuffer

          void writeToBuffer(Buffer buffer)

      Method invoked when serializing this instance.
      Specified by:
        `writeToBuffer` in interface `io.vertx.core.shareddata.impl.ClusterSerializable`
      Parameters:
        `buffer` - the `Buffer` where the serialized bytes must be written to

    - #### readFromBuffer

          int readFromBuffer(int pos,
                             Buffer buffer)

      Method invoked when deserializing bytes to this instance.
      Specified by:
        `readFromBuffer` in interface `io.vertx.core.shareddata.impl.ClusterSerializable`
      Parameters:
        `pos` - the position where to start reading the `buffer`
        `buffer` - the `Buffer` where the serialized bytes must be read from
      Returns:
        the position after the last serialized byte

Copyright © 2023 Eclipse. All rights reserved.