ALE.FileSystem.File.Read C# (CSharp) Method

Read() public static method

Reads a file as a stream in chunks.
public static Read ( string path, Action callback ) : void
path string The file path.
callback Action Called when a chunk is read.
return void
        public static void Read(string path, Action<Exception, long, byte[]> callback)
        {
            var fs = System.IO.File.OpenRead(path);
            var buffer = new byte[DefaultBufferSize];
            var state = new ReadAsyncCallbackState(fs, buffer, callback);
            fs.BeginRead(buffer, 0, buffer.Length, ReadAsyncCallback, state);
        }