错误

程序截图
Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1
报错截图
Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1

原因

看一下fromFile的源代码,就清楚错误原因了
Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1

解决方法

看一下文件的编码格式(很多文本编辑器可以看),然后在代码中指定读取文件的编码格式(要和文件的编码一致)。
Exception in thread "main" java.nio.charset.MalformedInputException: Input length = 1
我这里文件是GBK编码,在代码中指定为GBK就好了

相关文章:

  • 2021-08-11
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-18
  • 2021-04-03
  • 2022-12-23
  • 2021-06-03
  • 2021-08-29
  • 2021-11-28
相关资源
相似解决方案