CSharp examples for System.IO:Stream
Return all bytes from current stream position to the end of the stream
using System.Text; using System.IO;//from ww w. j a v a 2 s . co m using System.Collections.Generic; using System; public class Main{ /// <summary> /// Return all bytes from current stream position to the end of the stream /// </summary> public static byte[] ReadAllBytes(Stream stream) { byte[] buffer = new byte[stream.Length - stream.Position]; stream.Read(buffer, 0, buffer.Length); return buffer; } }