Loading .bytes resource as TextAsset to get byte[]

I have a number of files that I need to embed into my application without modification (target platform is Android). I have Unity Pro.

At runtime the files need to be transferred to another device that I connect to using Bluetooth.

The files contain raw graphics in a custom format - the format is quite close to tiff but not quite tiff. I have no use for anything but the raw content of the file as a byte array.

I have 129 of these files - I have renamed the extension for all of them to .bytes (which should be supported by TextAsset) and put them in a Resources folder inside my Assets folder and load them using Resources.Load(path).

This works for 59 of them - they come back as TextAsset from which I can get the content of the resource as byte. But the remaining files I get as Texture2D??

According to the online manual Texture2D has a GetRawTextureData that should give me the byte array - but sadly this method is NOT available in Unity 4.6.7 and gives me a compile error if I try to use it. Unity - Scripting API: Texture2D.GetRawTextureData

I don’t ever want my files back as Texture2D - is there a way to force Resources.Load to give me a TextAsset?

Is there a backwards compatible way of getting the byte data for a Texture2D?

I only need the byte with the file contents - so other ways of doing just that for a Resource is most welcome.

I have had similar situations where I have a non standard asset that I want to load from resources and save to the devices folder structure at runtime. The comments on @frjtrifork 's question worked perfectly. To summarize:

  1. Rename your asset’s file extension to “.bytes” (If you’re in Windows you may have to enable viewing file extensions)
  2. Place your newly renamed asset in the Resources folder in your Unity project
  3. Run “TextAsset asset = Resources.Load(“asset/file/path”);”
  4. Then “File.WriteAllBytes(“device/file/path.originalExtension”, asset.bytes);”