2package com.jogamp.common.nio;
4import java.io.IOException;
6import jogamp.common.os.PlatformPropsImpl;
8import com.jogamp.common.os.*;
9import com.jogamp.junit.util.SingletonJunitCase;
11import org.junit.Assert;
14import static java.lang.System.*;
16import org.junit.FixMethodOrder;
17import org.junit.runners.MethodSorters;
19@FixMethodOrder(MethodSorters.NAME_ASCENDING)
22 protected void testImpl (
final boolean direct) {
24 final int bitsPtr = machine.pointerSizeInBytes() * 8;
25 final String bitsProp = System.getProperty(
"sun.arch.data.model");
26 out.println(
"OS: <"+PlatformPropsImpl.OS+
"> CPU: <"+PlatformPropsImpl.ARCH+
"> Bits: <"+bitsPtr+
"/"+bitsProp+
">");
29 final long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL };
30 final long[] values32Bit = { 0x0000000089ABCDEFL, 0x0000000044332211L, 0x00000000BEEFAFFEL };
33 ptr.
put(valuesSource, 0, valuesSource.length);
38 final long v = ptr.
get() ;
40 Assert.assertTrue(
"Value["+i+
"] shall be 0x"+Long.toHexString(t)+
", is: 0x"+Long.toHexString(v), t == v);
43 Assert.assertTrue(
"iterator "+i+
" != "+valuesSource.length, i==valuesSource.length);
56 public static void main(
final String args[])
throws IOException {
58 org.junit.runner.JUnitCore.
main(tstname);
final boolean hasRemaining()
Hardware independent container holding an array of native pointer, while its getDirectBufferAddress()...
static PointerBuffer allocateDirect(final int size)
Returns a direct PointerBuffer in native order, w/o backup array.
static PointerBuffer allocate(final int size)
Returns a non direct PointerBuffer, having a backup array.
final PointerBuffer put(final PointerBuffer src)
final long get(final int idx)
Absolute get method.
void testImpl(final boolean direct)
static void main(final String args[])
Machine data description for alignment and size onle, see com.jogamp.gluegen.
StringBuilder toString(StringBuilder sb)