Exemple #1
0
        public ushort ReadUInt16()
        {
            ushort result = FastBitConverter.ToUInt16(_data, _position);

            _position += 2;
            return(result);
        }
Exemple #2
0
        private T[] _ReadArray <T>(Func <T> _func)
        {
            ushort size = FastBitConverter.ToUInt16(_data, _position);

            _position += 2;
            var arr = new T[size];

            for (int i = 0; i < size; i++)
            {
                arr[i] = _func();
            }

            return(arr);
        }
Exemple #3
0
        public bool SetSlotOffset(int vTblOffset, int slotSize, int idx)
        {
            int offset     = (int)(vTblOffset + idx * slotSize);
            int dataOffset = _data[offset];

            if (slotSize == 4)
            {
                dataOffset = (int)FastBitConverter.ToUInt32(_data, offset);
            }
            else if (slotSize == 2)
            {
                dataOffset = FastBitConverter.ToUInt16(_data, offset);
            }
            _position = dataOffset;
            return(dataOffset != 0);
        }
Exemple #4
0
 public ushort PeekUShort()
 {
     return(FastBitConverter.ToUInt16(_data, _position));
 }
Exemple #5
0
 public uint ReadSlotInt16(uint offset, int idx)
 {
     return(FastBitConverter.ToUInt16(_data, (int)(offset + idx * 2)));
 }