Class MetadataValueBuilder

  • All Implemented Interfaces:
    Serializer

    public class MetadataValueBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout of a metadata entry value
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MetadataValueBuilder​(java.io.DataInputStream stream)
      Constructor - Creates an object from stream.
      protected MetadataValueBuilder​(java.nio.ByteBuffer data)
      Constructor.
    • Constructor Detail

      • MetadataValueBuilder

        protected MetadataValueBuilder​(java.io.DataInputStream stream)
        Constructor - Creates an object from stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
      • MetadataValueBuilder

        protected MetadataValueBuilder​(java.nio.ByteBuffer data)
        Constructor.
        Parameters:
        data - Data of the value.
    • Method Detail

      • loadFromBinary

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

        public static MetadataValueBuilder create​(java.nio.ByteBuffer data)
        Creates an instance of MetadataValueBuilder.
        Parameters:
        data - Data of the value.
        Returns:
        Instance of MetadataValueBuilder.
      • getStreamSize

        public short getStreamSize()
        Gets size of the value.
        Returns:
        Size of the value.
      • getData

        public java.nio.ByteBuffer getData()
        Gets data of the value.
        Returns:
        Data of the value.
      • getSize

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

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