Interface DataSerializable

All Known Subinterfaces:
IdentifiedDataSerializable, Member, ScheduledTaskStatistics, SplitBrainMergePolicy<V,T,R>, TenantControl, TypedDataSerializable
All Known Implementing Classes:
AbstractCacheConfig, com.hazelcast.spi.impl.merge.AbstractSplitBrainMergePolicy, AbstractWanPublisherConfig, Address, AliasedDiscoveryConfig, AttributeConfig, AwsConfig, AzureConfig, BitmapIndexOptions, BTreeIndexConfig, CacheConfig, CachePartitionLostListenerConfig, CacheSimpleConfig, CacheSimpleConfig.ExpiryPolicyFactoryConfig, CacheSimpleConfig.ExpiryPolicyFactoryConfig.DurationConfig, CacheSimpleConfig.ExpiryPolicyFactoryConfig.TimedExpiryPolicyFactoryConfig, CacheSimpleEntryListenerConfig, CardinalityEstimatorConfig, CollectionConfig, DAG, DataConnectionConfig, DataPersistenceConfig, DeltaJobConfig, DiscardMergePolicy, DiscoveryConfig, DiscoveryStrategyConfig, DiskTierConfig, DurableExecutorConfig, Echo, Edge, EdgeConfig, EntryListenerConfig, EurekaConfig, EventJournalConfig, EvictionConfig, ExecutorConfig, ExpirationTimeMergePolicy, FlakeIdGeneratorConfig, GcpConfig, HazelcastExpiryPolicy, HigherHitsMergePolicy, HotRestartConfig, HyperLogLogMergePolicy, IndexConfig, ItemListenerConfig, JobConfig, JobMetrics, JobStatusEvent, KubernetesConfig, LatestAccessMergePolicy, LatestUpdateMergePolicy, ListConfig, ListenerConfig, MapConfig, MapPartitionLostListenerConfig, MapStoreConfig, Measurement, MemberVersion, MemoryTierConfig, MergePolicyConfig, MerkleTreeConfig, MultiMapConfig, NearCacheConfig, NearCachePreloaderConfig, PartitionAwareKey, PartitioningAttributeConfig, PartitioningStrategyConfig, PassThroughMergePolicy, PermissionConfig, PNCounterConfig, PortableId, PredicateConfig, ProcessorMetaSupplier.ExpectNothingProcessorSupplier, ProcessorMetaSupplier.RandomMemberPms, ProcessorMetaSupplier.SpecificMemberPms, PutIfAbsentMergePolicy, QueryCacheConfig, QueueConfig, QueueStoreConfig, ReliableTopicConfig, ReplicatedMapConfig, ResourceConfig, RingbufferConfig, RingbufferStoreConfig, ScheduledExecutorConfig, ScheduledTaskHandler, SetConfig, SimpleTokenCredentials, SplitBrainProtectionConfig, SplitBrainProtectionListenerConfig, TieredStoreConfig, TopicConfig, TransactionOptions, UserCodeNamespaceConfig, UsernamePasswordCredentials, Version, Vertex, WanBatchPublisherConfig, WanConsumerConfig, WanCustomPublisherConfig, WanReplicationConfig, WanReplicationRef, WanSyncConfig

public interface DataSerializable
DataSerializable is a serialization method alternative to standard Java serialization. DataSerializable is very similar to Externalizable and relies on reflection to create instances using class names.

Conforming classes must provide a no-arguments constructor to facilitate the creation of their instances during the deserialization. Anonymous, local and non-static member classes can't satisfy this requirement since their constructors are always accepting an instance of the enclosing class as an implicit argument, therefore they must be avoided.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads fields from the input stream
    void
    Writes object fields to output stream
  • Method Details

    • writeData

      void writeData(ObjectDataOutput out) throws IOException
      Writes object fields to output stream
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      void readData(ObjectDataInput in) throws IOException
      Reads fields from the input stream
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.