using UnityEngine; using System.Collections; using System; using System.IO; public class Test : MonoBehaviour { void Start () { TextAsset binData=Resources.Load<TextAsset> ("wp");//Resources文件夹下的wp.bytes, 后缀名必须为.bytes.读取swf文件,需改后缀名 byte[] bytes = binData.bytes; readBytes (bytes); } private void readBytes(byte[] bytes){ MemoryStream memStream = new MemoryStream (bytes); BinaryReader br = new BinaryReader (memStream); Debug.Log ("Position:"+memStream.Position);// 0 Debug.Log(br.ReadByte ());//0x43==67 c Debug.Log(br.ReadByte ());//0x57==87 w Debug.Log(br.ReadByte ());//0x53==83 s Debug.Log ("Position:"+memStream.Position);// 3 Debug.Log (0x43+","+ 0x57+","+ 0x53); } }
C# 读取二进制文件
免责声明:文章转载自《C# 读取二进制文件》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇XCode常用快捷键的使用windows 创建指定大小文件下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=