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

            _position += 2;
            return(result);
        }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
 public ushort PeekUShort()
 {
     return(FastBitConverter.ToUInt16(_data, _position));
 }
예제 #5
0
 public uint ReadSlotInt16(uint offset, int idx)
 {
     return(FastBitConverter.ToUInt16(_data, (int)(offset + idx * 2)));
 }