예제 #1
0
        public uint Read(byte [] data, uint pos)
        {
            Offset = MemoryMappedFileReader.ConvertToUintBE(data, pos);
            pos   += 4;
            Length = MemoryMappedFileReader.ConvertToUintBE(data, pos);
            pos   += 4;

            return(pos);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }