Add support for java.nio.Buffer
including test-suite test case and documentation
This commit is contained in:
parent
287e84d84c
commit
093fe2a556
4 changed files with 69 additions and 0 deletions
|
|
@ -83,6 +83,25 @@ public class java_lib_various_runme {
|
|||
if (byjove[i] != b[i])
|
||||
throw new RuntimeException("By jove, it failed: [" + new String(b) + "]");
|
||||
}
|
||||
|
||||
// NIOBUFFER typemap check
|
||||
java.nio.ByteBuffer buf = java.nio.ByteBuffer.allocateDirect(10);
|
||||
java_lib_various.niobuffer_fill_hello(buf);
|
||||
if (
|
||||
(char)buf.get(0) != 'h' ||
|
||||
(char)buf.get(1) != 'e' ||
|
||||
(char)buf.get(2) != 'l' ||
|
||||
(char)buf.get(3) != 'l' ||
|
||||
(char)buf.get(4) != 'o'
|
||||
)
|
||||
throw new RuntimeException(
|
||||
"nio test failed: " +
|
||||
(char)buf.get(0) +
|
||||
(char)buf.get(1) +
|
||||
(char)buf.get(2) +
|
||||
(char)buf.get(3) +
|
||||
(char)buf.get(4)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue