public async Task <byte[]> ReadBytes(int count) { var output = await Parent.ReadBytes((int)Math.Min(count, Available)); Read += output.Length; return(output); }
public static async Task Skip(this IAsyncReadable reader, long count) { var remaining = count; while (remaining > 0) { var chunk = (int)Math.Min(1024, remaining); var data = await reader.ReadBytes(chunk); remaining -= data.Length; } }