これを試すと、.twaファイルを開くのに役立ちます。私は私のファイル
まずでやったこれはByteArrayInputStream
private ByteArrayInputStream file_hnd;
は、今すぐあなたのByteArrayすなわちfile_hndは、そのファイルからすべてのデータを持っている
try {
{
InputStream fip = null;
)
fip = getAssets().open("My Files/" + file_name);//Your driectory and file name
/* else
{
fip=new FileInputStream(f);
}*/
byte[] b = new byte[fip.available()];
fip.read(b);
file_hnd = new ByteArrayInputStream(b);
fip.close();
file_hnd.mark(file_hnd.available() + 1);
return true;
}
} catch (Exception e) {
e.printStackTrace();
}
として、ファイルを開いてみてください持っています。読んで私はこれをしました
try {
file_hnd.reset();
int chars, i = 0, index = 0;
while ((chars = file_hnd.read()) != -1) {
aDes[index++] = (byte) chars;//Do your reading here
}
} catch (Exception e) {
e.printStackTrace();
}
私はこれを助けました。
あなたが求めていることは明確ではありません。 – Yazan
まだ明らかではない、資産から**ファイル**を読んでいるときに問題が発生している場合、またはこのファイルに読書/解析/変換の助けが必要な特別なものがありますか?それが資産の問題であれば、これはあなたに役立ちますhttp://stackoverflow.com/questions/9544737/read-file-from-assets – Yazan
彼らは.txtファイルを読み込んでいます。私は.twaファイルを持っています – UserDev