public byte[] ExtractTagRaw(Stream stream, TagInstance tag)
{
if (tag == null)
throw new ArgumentNullException(nameof(tag));
if (tag.HeaderOffset < 0)
throw new ArgumentException("The tag is not in the cache file");
stream.Position = tag.HeaderOffset;
var result = new byte[tag.TotalSize];
stream.Read(result, 0, result.Length);
return result;
}