Class BlockDurationDto

  • All Implemented Interfaces:
    Serializer

    public final class BlockDurationDto
    extends java.lang.Object
    implements Serializer
    Block duration.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockDurationDto​(long blockDuration)
      Constructor.
      BlockDurationDto​(java.io.DataInputStream stream)
      Constructor - Creates an object from stream.
    • Constructor Detail

      • BlockDurationDto

        public BlockDurationDto​(long blockDuration)
        Constructor.
        Parameters:
        blockDuration - Block duration.
      • BlockDurationDto

        public BlockDurationDto​(java.io.DataInputStream stream)
        Constructor - Creates an object from stream.
        Parameters:
        stream - Byte stream to use to serialize.
    • Method Detail

      • getBlockDuration

        public long getBlockDuration()
        Gets Block duration.
        Returns:
        Block duration.
      • getSize

        public int getSize()
        Gets the size of the object.
        Specified by:
        getSize in interface Serializer
        Returns:
        Size in bytes.
      • loadFromBinary

        public static BlockDurationDto loadFromBinary​(java.io.DataInputStream stream)
        Creates an instance of BlockDurationDto from a stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
        Returns:
        Instance of BlockDurationDto.
      • serialize

        public byte[] serialize()
        Serializes an object to bytes.
        Specified by:
        serialize in interface Serializer
        Returns:
        Serialized bytes.