Method ReadAllBytesAsync
ReadAllBytesAsync(string, CancellationToken)
Reads a whole remote file into a byte array, as ReadAllBytesAsync(string, CancellationToken) does locally, with many reads in flight.
public Task<byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken = default)
Parameters
pathstringcancellationTokenCancellationToken
Returns
Exceptions
- SftpException
The file does not exist (NoSuchFile), or another error.
- IOException
The file is larger than an array can hold (about 2 GiB).