decode static method
Decodes the FrameHeader
Returns null if the FrameHeader could not be decoded
Implementation
static Id3v22FrameHeader? decode(
Id3v2Header id3v2Header,
List<int> bytes,
int startIndex,
) {
String identifierId = latin1.decode(bytes.sublist(startIndex, startIndex + 3));
FrameIdentifier? frameIdentifier = frameIdentifiers.firstWhereOrNull((element) => element.v22Name == identifierId);
if (frameIdentifier == null) {
return null;
}
var contentSize = _decodeFrameSize(bytes, startIndex + identifierFieldSize);
return Id3v22FrameHeader(frameIdentifier, contentSize);
}