public async Task <int> LoadEntirelyAsync()
        {
            data = new byte[dataLenght];

            await JsFastDataExchanger.GetBinaryData(this);

            progressInfo = ".net loaded 100 of 100%";
            OnDataRead?.Invoke(100);

            OnFinish?.Invoke();

            return(1);
        }
        public async Task <int> LoadByPortionsAsync()
        {
            data = new byte[dataLenght];


            int CurrentPercent = 0;

            double p;

            while (position < dataLenght)
            {
                p = position * 100.0 / dataLenght;

                chunkSize = Math.Min(chunkSize, dataLenght - position);

                await JsFastDataExchanger.GetBinaryDataByPortions(this);

                position += chunkSize;

                if (CurrentPercent != (int)p)
                {
                    CurrentPercent = (int)p;
                    progressInfo   = ".net loaded " + (int)p + " of 100%";

                    OnDataRead?.Invoke(CurrentPercent);
                }
            }

            progressInfo = ".net loaded 100 of 100%";
            OnDataRead?.Invoke(100);

            JsFastDataExchanger.DeleteGlobalVariable(variableName);

            OnFinish?.Invoke();


            return(1);
        }