gpt4 book ai didi

java-me - 在 j2me 异常中无法访问根目录

转载 作者:行者123 更新时间:2023-12-02 01:59:18 24 4
gpt4 key购买 nike

FileConnection fc = (FileConnection)Connector.open("file:///C:/products.dat",Connector.READ_WRITE);
if(!fc.exists())
{
fc.create();
OutputStream os=fc.openOutputStream();
byte[] b=response.toString().getBytes();
os.write(b);
os.flush();
fc.close();
}

最佳答案

您提供的路径似乎不是有效的根。要检查设备中所有有效根值的列表,请调用 FileSystemRegistry 的 listRoots() 方法。

其他原因可能是由于某些原因 FileSystemRegistry 无法访问该路径(磁盘错误或读保护)。

关于java-me - 在 j2me 异常中无法访问根目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18056951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com