SecureData.deserialize constructor

SecureData.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory SecureData.deserialize(BinaryReader reader) {
  // Read [SecureData] fields.
  final data = reader.readBytes();
  final dataHash = reader.readBytes();
  final secret = reader.readBytes();

  // Construct [SecureData] object.
  final returnValue = SecureData(
    data: data,
    dataHash: dataHash,
    secret: secret,
  );

  // Now return the deserialized [SecureData].
  return returnValue;
}