cert.der:打开失败:ENOENT(没有那个文件或目录)

cert.der: open failed: ENOENT (No such file or directory)

InputStream caInput = new BufferedInputStream(new FileInputStream("cert.der"));

09-10 20:59:02.526: I/System.out(11341): ssdada cert.der: open failed: ENOENT (No such file or directory)

我正在使用 android 和 eclipse。我在应用程序级别上有 cert.der,在我的 src 文件夹下..在同一个文件夹下,还有我从中调用上述代码的 Class。 还是添加到哪里?

您应该将其放在 rawassets 中。 Documentation.

raw/
Arbitrary files to save in their raw form. To open these resources with a raw InputStream, call Resources.openRawResource() with the resource ID, which is R.raw.filename.

However, if you need access to original file names and file hierarchy, you might consider saving some resources in the assets/ directory (instead of res/raw/). Files in assets/ are not given a resource ID, so you can read them only using AssetManager.