0
如何從virtual file
讀取文件內容。我目前使用這種方式從VirtualFile讀取文件內容 - intellij插件開發
BufferedReader br = new BufferedReader(new InputStreamReader(virtualFile.getInputStream()));
String currentLine;
StringBuilder stringBuilder = new StringBuilder();
while ((currentLine = br.readLine()) != null) {
stringBuilder.append(currentLine);
stringBuilder.append("\n");
}
} catch (IOException e1) {
e1.printStackTrace();
return 0;
}
但是我得到附加一些亂碼字符串時,我打印stringbuilder
。
工作正常 – Bijesh