Closed TmacZhang closed 11 months ago
I ported it to Android kernel5.15 and turned off selinux to ensure that there were no issues with the system call, but it still couldn't be used and there were no errors in the log
try { NativeLibraryLoader.load(); File file = new File(getContext().getCacheDir(), "testnio"); if (!file.exists()) { file.createNewFile(); } IoUringFile ioUringFile = new IoUringFile(file.getPath()); ioUringFile.onRead(in -> { Log.i("jin1", "111 = " +StandardCharsets.UTF_8.decode(in)); ioUringFile.close(); }); Log.i("jin1", "222 = " ); new IoUring() .queueRead(ioUringFile, ByteBuffer.allocateDirect(8192)) .execute(); String text = "Hello, World!"; Charset charset = Charset.forName("UTF-8"); ByteBuffer buffer = ByteBuffer.allocateDirect(text.length() * 4); buffer.put(charset.encode(text)); buffer.flip(); new IoUring().queueWrite(ioUringFile, buffer).execute(); } catch (Exception e) { }
closed
Were you able to resolve this?
I ported it to Android kernel5.15 and turned off selinux to ensure that there were no issues with the system call, but it still couldn't be used and there were no errors in the log