Skip to content

Commit

Permalink
feat(IFileSystemApi): read from offset
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Mar 15, 2018
1 parent da58919 commit a934fe7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/CoreApi/IFileSystemApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,27 @@ public interface IFileSystemApi
Task<String> ReadAllTextAsync(string path, CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Reads an existing IPFS file.
/// Reads an existing IPFS file with the specified offset.
/// </summary>
/// <param name="path">
/// A path to an existing file, such as "QmXarR6rgkQ2fDSHjSY5nM2kuCXKYGViky5nohtwgF65Ec/about"
/// or "QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V"
/// </param>
/// <param name="offset">
/// The position to start reading from.
/// </param>
/// <param name="count">
/// The number of bytes to read. If zero, then the remaining bytes
/// from <paramref name="offset"/> are read. Defaults to zero.
/// </param>
/// <param name="cancel">
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised.
/// </param>
/// <returns>
/// A task that represents the asynchronous operation. The task's value is
/// a <see cref="Stream"/> to the file contents.
/// </returns>
Task<Stream> ReadFileAsync(string path, CancellationToken cancel = default(CancellationToken));
Task<Stream> ReadFileAsync(string path, long offset, long count = 0, CancellationToken cancel = default(CancellationToken));

/// <summary>
/// Get information about the file or directory.
Expand Down

0 comments on commit a934fe7

Please sign in to comment.