IVersionedSerializer (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.io

## Interface IVersionedSerializer<T>

- All Known Subinterfaces:
    RepairMessage.MessageSerializer<T>
  All Known Implementing Classes:
    AnticompactionRequest.AnticompactionRequestSerializer, BooleanSerializer, BootStrapper.StringSerializer, CleanupMessage.CleanupMessageSerializer, Commit.CommitSerializer, CounterMutation.CounterMutationSerializer, EchoMessage.EchoMessageSerializer, ForwardingVersionedSerializer, HintMessage.Serializer, IntervalTree.Serializer, MerkleTree.MerkleTreeSerializer, MerkleTrees.MerkleTreesSerializer, MigrationManager.MigrationsSerializer, Mutation.MutationSerializer, NodePair.NodePairSerializer, PrepareMessage.PrepareMessageSerializer, PrepareResponse.PrepareResponseSerializer, RepairMessage.RepairMessageSerializer, SnapshotMessage.SnapshotMessageSerializer, StreamRequest.StreamRequestSerializer, StreamSummary.StreamSummarySerializer, SyncRequest.SyncRequestSerializer, TruncateResponse.TruncateResponseSerializer, UUIDSerializer, ValidationRequest.ValidationRequestSerializer, WriteResponse.Serializer

      public interface IVersionedSerializer<T>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `deserialize(DataInputPlus in, int version)` Deserialize into the specified DataInputStream instance.
    `void` | `serialize(T t, DataOutputPlus out, int version)` Serialize the specified type into the specified DataOutputStream instance.
    `long` | `serializedSize(T t, int version)` Calculate serialized size of object without actually serializing.

- - ### Method Detail

    - #### serialize

          void serialize(T t,
                         DataOutputPlus out,
                         int version)
                  throws java.io.IOException

      Serialize the specified type into the specified DataOutputStream instance.
      Parameters:
        `t` - type that needs to be serialized
        `out` - DataOutput into which serialization needs to happen.
        `version` - protocol version
      Throws:
        `java.io.IOException` - if serialization fails

    - #### deserialize

          T deserialize(DataInputPlus in,
                        int version)
                 throws java.io.IOException

      Deserialize into the specified DataInputStream instance.
      Parameters:
        `in` - DataInput from which deserialization needs to happen.
        `version` - protocol version
      Returns:
        the type that was deserialized
      Throws:
        `java.io.IOException` - if deserialization fails

    - #### serializedSize

          long serializedSize(T t,
                              int version)

      Calculate serialized size of object without actually serializing.
      Parameters:
        `t` - object to calculate serialized size
        `version` - protocol version
      Returns:
        serialized size of object t

Copyright © 2018 The Apache Software Foundation