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