Beispiel #1
0
        public async Task <byte[]> ReadBytes(int count)
        {
            var output = await Parent.ReadBytes((int)Math.Min(count, Available));

            Read += output.Length;
            return(output);
        }
Beispiel #2
0
        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;
            }
        }