Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make ReadAllAsync public #99

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/OrasProject.Oras/Content/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static class Extensions
/// <param name="node"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<IEnumerable<Descriptor>> GetSuccessorsAsync(this IFetchable fetcher, Descriptor node, CancellationToken cancellationToken)
public static async Task<IEnumerable<Descriptor>> GetSuccessorsAsync(this IFetchable fetcher, Descriptor node, CancellationToken cancellationToken = default)
{
switch (node.MediaType)
{
Expand Down Expand Up @@ -71,7 +71,7 @@ public static async Task<IEnumerable<Descriptor>> GetSuccessorsAsync(this IFetch
/// <param name="desc"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<byte[]> FetchAllAsync(this IFetchable fetcher, Descriptor desc, CancellationToken cancellationToken)
public static async Task<byte[]> FetchAllAsync(this IFetchable fetcher, Descriptor desc, CancellationToken cancellationToken = default)
{
var stream = await fetcher.FetchAsync(desc, cancellationToken).ConfigureAwait(false);
return await stream.ReadAllAsync(desc, cancellationToken).ConfigureAwait(false);
Expand All @@ -86,7 +86,7 @@ public static async Task<byte[]> FetchAllAsync(this IFetchable fetcher, Descript
/// <exception cref="InvalidDescriptorSizeException"></exception>
/// <exception cref="ArgumentOutOfRangeException"></exception>
/// <exception cref="MismatchedDigestException"></exception>
internal static async Task<byte[]> ReadAllAsync(this Stream stream, Descriptor descriptor, CancellationToken cancellationToken)
public static async Task<byte[]> ReadAllAsync(this Stream stream, Descriptor descriptor, CancellationToken cancellationToken = default)
{
if (descriptor.Size < 0)
{
Expand Down
Loading