public uint Read(byte [] data, uint pos) { Offset = MemoryMappedFileReader.ConvertToUintBE(data, pos); pos += 4; Length = MemoryMappedFileReader.ConvertToUintBE(data, pos); pos += 4; return(pos); }
public Box(byte[] buffer, uint start) { Size = MemoryMappedFileReader.ConvertToUintBE(buffer, start); Kind = Encoding.ASCII.GetString(buffer, (int)start + 4, 4); if (Size > buffer.Length - start) { return; //bad offset or size } Data = new byte[Size - 8]; Array.Copy(buffer, start + 8, Data, 0, Size - 8); }
public LocationsList(Box gpsCatalog) { uint off = 0; Version = MemoryMappedFileReader.ConvertToUintBE(gpsCatalog.Data, off); off += 4; EncodedDate = MemoryMappedFileReader.ConvertToUintBE(gpsCatalog.Data, off); off += 4; while (off < gpsCatalog.Data.Length) { Location l = new Location(); off = l.Read(gpsCatalog.Data, off); locations.Add(l); } }