public T Cast <T>(int idx) where T : class { if (idx < 0 || datas.Length <= idx) { throw new ArgumentOutOfRangeException(nameof(idx)); } NativeClass <T> cc = NativeClass <T> .Instance; fixed(byte *ptr = datas) return(cc.Cast(ptr + idx)); }