javafx加载sokoban文件
有人能告诉我我的代码出了什么问题吗?尝试将文件加载到javafx加载sokoban文件,java,file,javafx,fileloadexception,Java,File,Javafx,Fileloadexception,有人能告诉我我的代码出了什么问题吗?尝试将文件加载到fileInputStream 错误消息: java.io.FileNotFoundException: file:\C:\Users\zzxx\Desktop\netBean\hw3\Sokoban_draft\data\1.sok (The filename, directory name, or volume label syntax is incorrect) at java.io.FileInputStream.open(Native
fileInputStream
错误消息:
java.io.FileNotFoundException: file:\C:\Users\zzxx\Desktop\netBean\hw3\Sokoban_draft\data\1.sok (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
您不需要指定文件协议。(文件://)
只需使用路径名即可。您是否有一个“文件:”驱动器,其中包含一个名为“C:”的文件夹?兄弟,我说,您不需要协议。使用“C:/Users/zzxx/Desktop/netBeanhw3/Sokoban_draft/data/1.sok”
String filePath = new String("file:///C:/Users/zzxx/Desktop/netBeanhw3/Sokoban_draft/data/1.sok");
GridRenderer gamePane = new GridRenderer();
File sokFile = new File(filePath);
byte[] bytes = new byte[Long.valueOf(sokFile.length()).intValue()];
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
FileInputStream fis = new FileInputStream(sokFile);
BufferedInputStream bis = new BufferedInputStream(fis);