Table of Contents

Method ReadAllBytesAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

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

path string
cancellationToken CancellationToken

Returns

Task<byte[]>

Exceptions

SftpException

The file does not exist (NoSuchFile), or another error.

IOException

The file is larger than an array can hold (about 2 GiB).