Class KeyDto

  • All Implemented Interfaces:
    Serializer

    public final class KeyDto
    extends java.lang.Object
    implements Serializer
    Key.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyDto​(java.io.DataInputStream stream)
      Constructor - Creates an object from stream.
      KeyDto​(java.nio.ByteBuffer key)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer getKey()
      Gets Key.
      int getSize()
      Gets the size of the object.
      static KeyDto loadFromBinary​(java.io.DataInputStream stream)
      Creates an instance of KeyDto from a stream.
      byte[] serialize()
      Serializes an object to bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyDto

        public KeyDto​(java.nio.ByteBuffer key)
        Constructor.
        Parameters:
        key - Key.
      • KeyDto

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

      • getKey

        public java.nio.ByteBuffer getKey()
        Gets Key.
        Returns:
        Key.
      • getSize

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

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

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