public unsafe List <OggPage> GetPageHeaders() { List <OggPage> list = new List <OggPage>(); byte * ptr = (byte *)Data; byte * end = ptr + Length; while (ptr < end) { string capturePattern = new string((sbyte *)ptr, 0, 4); if (capturePattern != "OggS") { throw new Exception("OggS expected, but not found"); } OggPageHeader *pageHeader = (OggPageHeader *)ptr; list.Add(new OggPage(this, pageHeader)); byte *segmentTable = (byte *)pageHeader + 27; ptr = segmentTable + pageHeader->PageSegments; for (int i = 0; i < pageHeader->PageSegments; i++) { ptr += segmentTable[i]; } } if (ptr > end) { throw new Exception("Unexpected end of file"); } return(list); }
internal OggPage(VorbisFile parent, OggPageHeader *header) { this.Parent = parent; this.Header = header; }