The first step is to save your binary data file with the “.bytes” extension. Unity will treat this file as a TextAsset. With TextAsset object in hand, you can get bytes at once. Here is the code to load binary data from Resources folder:
TextAsset binayAsset = Resources.Load<TextAsset >("level/level_info");
byte[] buf = binaryAsset.bytes;
As a TextAsset the file can be included when you build your AssetBundle. Once you have downloaded the AssetBundle in your application and loaded the TextAsset object, you can use the .bytes property of the TextAsset to retrieve your binary data.
In addition to work with AssetBundles, those binary data also can be access with WWW and downloaded, then retrieve the binary content with remote url.
WWW www = new WWW("binary data url");
yield return www;
if (string.IsEmpty(www.error)) {
byte[] buf = www.bytes;
}
With WWW
class, we could get the binary data with files under StreammingAssets folder.