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

FileReadAllAsync() private static method

private static FileReadAllAsync ( string path, byte[]>.Action complete ) : void
path string
complete byte[]>.Action
return void
        private static void FileReadAllAsync(string path, Action<Exception, byte[]> complete)
        {
            try
            {
                var fs = System.IO.File.OpenRead(path);
                var buffer = new byte[fs.Length];
                var state = new AsyncFileReadState(complete, fs, buffer);
                fs.BeginRead(buffer, 0, buffer.Length, FileReadAllCallback, state);
            } catch (Exception ex)
            {
                EventLoop.Pend(() => complete(ex, null));
            }
        }