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

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