/// <summary> /// Reads the file at the specified file path without allocating a new byte array. /// </summary> /// <param name="path">The specified path to read from.</param> /// <param name="data">The byte buffer to load the file content into.</param> /// <returns>Returns an file read operation for async code or coroutines.</returns> public static FileReadOperation ReadFileNonAlloc(string path, byte[] data) { var operation = new FileReadOperation(); ReadFileNonAlloc(path, data, operation.Done); return(operation); }
/// <summary> /// Reads the file at the specified file path. /// </summary> /// <param name="path">The specified path to read from.</param> /// <returns>Returns an file read operation for async code or coroutines.</returns> public static FileReadOperation ReadFile(string path) { var operation = new FileReadOperation(); ReadFile(path, operation.Done); return(operation); }