readFromChunk static method
Implementation
static List<SampleHeader> readFromChunk(BinaryReader reader, int size)
{
if (size % 46 != 0)
{
throw "The sample header list is invalid.";
}
int count = (size ~/ 46) - 1;
// The last one is the terminator.
List<SampleHeader> headers = [];
for (int i = 0; i < count; i++)
{
headers.add(
SampleHeader.fromReader(reader),
);
}
// The last one is the terminator.
SampleHeader.fromReader(reader);
return headers;
}