从android文件中读取二进制数据
问题描述:
我在C#中使用代码读取二进制数据并转换为字符串
I have working code in C# for read binary data and converted to string
BinaryReader br = new BinaryReader(File.OpenRead(ofd.FileName));
string data1 = null;
for (int i = 0x000001; i <= 0x000002; i++)
{
br.BaseStream.Position = i;
data1 += br.ReadByte().ToString("X2");
}
if (data1 == "0102") label1.Text = "Trees";
i希望用Java编写代码,但我知道怎么回事
我尝试了什么:
据我所知java使用文件流
有一些java代码,但这个读取整个文件
i want to making that code working in Java, but i donk know how
What I have tried:
as far i know java use filestream
have some java code but this read whole file
FileInputStream fis = new FileInputStream(myExternalFile);
DataInputStream in = new DataInputStream(fis);
BufferedReader br =
new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
myData = myData + strLine;
}
in.close();
答
您有没有想过 Mobile App Development& App Creation Software - Xamarin [ ^ ] - 它现在是Microsoft工具集,以便您可以使用C#代码!
Have you thought about Mobile App Development & App Creation Software - Xamarin[^] - it is now part of the Microsoft toolset so you can use C# code!