Illegal character in opaque part at index

简介: Illegal character in opaque part at index

在我这里主要是因为windows用FileChannel 路径问题 ,代码如下

ByteBuffer byteBuffer = ByteBuffer.allocate(1024);
FileChannel fileChannel = FileChannel.open(Paths.get(URI.create("file:\\D:\\soft\\doc\\filechanel.txt")) );
        int readInt = fileChannel.read(byteBuffer);

这里是不对的,不支持反斜杠

file:\\D:\\soft\\doc\\filechanel.txt 或者D:\\soft\\doc\\filechanel.txt

正确应是:

file:/D:/soft/doc/filechanel.txt


相关文章
|
SQL
Parameter ‘id‘ not found. Available parameters are [collection, list]
Parameter ‘id‘ not found. Available parameters are [collection, list]
233 0
|
6月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
117 0
|
6月前
|
前端开发 JavaScript
Error_ Multipart_ Boundary not foun
Error_ Multipart_ Boundary not foun
101 0
|
JSON 数据格式
Required request parameter ‘name‘ for method parameter type String is not present 报错解决方法
Required request parameter ‘name‘ for method parameter type String is not present 报错解决方法
3709 0
|
应用服务中间件 nginx Windows
1113: No mapping for the Unicode character exists in the target multi-byte code page
1113: No mapping for the Unicode character exists in the target multi-byte code page
688 0
1113: No mapping for the Unicode character exists in the target multi-byte code page
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
297 0
成功解决ValueError: Number of passed names did not match number of header fields in the file
成功解决ValueError: Number of passed names did not match number of header fields in the file
|
SQL Java 数据库
PreparedStatement 模糊匹配 结果却:Parameter index out of range (1 > number of parameters, which is 0)
PreparedStatement 模糊匹配 结果却:Parameter index out of range (1 > number of parameters, which is 0)
463 0
成功解决ValueError: Parameter values for parameter (n_estimators) need to be a sequence.
成功解决ValueError: Parameter values for parameter (n_estimators) need to be a sequence.
成功解决ValueError: Parameter values for parameter (n_estimators) need to be a sequence.