ChunkBegin() public static method

public static ChunkBegin ( ChunkHeader header ) : void*
header ChunkHeader
return void*
Beispiel #1
0
        internal unsafe StringReferenceChunk(ChunkHeader *header) : base(header)
        {
            var begin    = (byte *)ChunkHeader.ChunkBegin(header);
            var end      = begin + header->Size;
            var curBegin = begin;
            var cur      = begin;

            Strings = new List <StringReference>();

            while (cur < end)
            {
                if (*cur == 0)
                {
                    var length = (int)(cur - curBegin);
                    if (length > 0)
                    {
                        Strings.Add(new StringReference
                        {
                            String = Marshal.PtrToStringAnsi((IntPtr)curBegin, length),
                            Offset = (int)(curBegin - begin)
                        });
                    }
                    curBegin = cur + 1;
                }
                cur++;
            }
        }
Beispiel #2
0
        internal unsafe OffsetChunk(ChunkHeader *header) : base(header)
        {
            Offsets = new int[header->Size / sizeof(int)];
            var cur = (int *)ChunkHeader.ChunkBegin(header);

            for (var i = 0; i < Offsets.Length; i++)
            {
                Offsets[i] = *cur++;
            }
        }