private static async Task ReadAsync(FileStreamReader state)
        {
            if (state._cancellationToken.IsCancellationRequested)
            {
                state._writer.Complete();
            }

Read:
            var buffer = state._writer.GetMemory(state._bufferSize);
            var numBytes = await state._file.ReadAsync(buffer, state._cancellationToken.Token);

            state._writer.Advance(numBytes);

            var awaitable = state._writer.FlushAsync(state._cancellationToken.Token);

            if (numBytes == 0)
            {
                state._writer.Complete();

                // The operation can be disposed when there's nothing more to produce
                state.Dispose();
            }
            else if (awaitable.IsCompleted)
            {
                // No back pressure being applied to continue reading
                goto Read;
            }
            else
            {
                var flushResult = await awaitable;
                if (!flushResult.IsCompleted)
                {
                    goto Read;
                }
                else
                {
                    state._writer.Complete();

                    state.Dispose();
                }
            }
        }
        public static FileStreamReader ReadFile(string path, int bufferSize = 4069, FileOptions fileOptions = FileOptions.Asynchronous)
        {
            var file = new FileStreamReader(path, bufferSize, fileOptions);

            return(file);
        }