DocumentAttributeAudio.deserialize constructor
DocumentAttributeAudio.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory DocumentAttributeAudio.deserialize(BinaryReader reader) {
// Read [DocumentAttributeAudio] fields.
final flags = reader.readInt32();
final voice = (flags & 1024) != 0;
final duration = reader.readInt32();
final hasTitleField = (flags & 1) != 0;
final title = hasTitleField ? reader.readString() : null;
final hasPerformerField = (flags & 2) != 0;
final performer = hasPerformerField ? reader.readString() : null;
final hasWaveformField = (flags & 4) != 0;
final waveform = hasWaveformField ? reader.readBytes() : null;
// Construct [DocumentAttributeAudio] object.
final returnValue = DocumentAttributeAudio(
voice: voice,
duration: duration,
title: title,
performer: performer,
waveform: waveform,
);
// Now return the deserialized [DocumentAttributeAudio].
return returnValue;
}