从android文件中读取二进制数据 [英] Read binary data from file for android
本文介绍了从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编写代码,但我知道怎么回事
< b>我尝试了什么:
据我所知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!
这篇关于从android文件中读取二进制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文