Package io.nem.symbol.catapult.builders
Class MetadataValueBuilder
- java.lang.Object
-
- io.nem.symbol.catapult.builders.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 protectedMetadataValueBuilder(java.io.DataInputStream stream)Constructor - Creates an object from stream.protectedMetadataValueBuilder(java.nio.ByteBuffer data)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetadataValueBuildercreate(java.nio.ByteBuffer data)Creates an instance of MetadataValueBuilder.java.nio.ByteBuffergetData()Gets data of the value.intgetSize()Gets the size of the object.shortgetStreamSize()Gets size of the value.static MetadataValueBuilderloadFromBinary(java.io.DataInputStream stream)Creates an instance of MetadataValueBuilder from a stream.byte[]serialize()Serializes an object to bytes.
-
-
-
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:
getSizein interfaceSerializer- Returns:
- Size in bytes.
-
serialize
public byte[] serialize()
Serializes an object to bytes.- Specified by:
serializein interfaceSerializer- Returns:
- Serialized bytes.
-
-