1package com.jogamp.common.nio;
3import static java.lang.System.out;
5import java.io.IOException;
6import java.nio.ByteBuffer;
8import jogamp.common.os.PlatformPropsImpl;
10import org.junit.Assert;
13import com.jogamp.common.os.MachineDataInfo;
14import com.jogamp.common.os.Platform;
15import com.jogamp.junit.util.SingletonJunitCase;
17import org.junit.FixMethodOrder;
18import org.junit.runners.MethodSorters;
20@FixMethodOrder(MethodSorters.NAME_ASCENDING)
26 final int bitsPtr = machine.pointerSizeInBytes() * 8;
27 final String bitsProp = System.getProperty(
"sun.arch.data.model");
28 out.println(
"OS: <"+PlatformPropsImpl.OS+
"> CPU: <"+PlatformPropsImpl.ARCH+
"> Bits: <"+bitsPtr+
"/"+bitsProp+
">");
32 final long[] valuesSource = { 0x0123456789ABCDEFL, 0x8877665544332211L, 0xAFFEDEADBEEFAFFEL };
38 for(i=0; i<valuesSource.length; i++) {
42 for(i=0; i<valuesSource.length; i++) {
44 final long t = valuesSource[i];
45 Assert.assertTrue(
"Value["+i+
"] shall be 0x"+Long.toHexString(t)+
", is: 0x"+Long.toHexString(v), t == v);
49 public static void main(
final String args[])
throws IOException {
51 org.junit.runner.JUnitCore.
main(tstname);
Utility methods allowing easy java.nio.Buffer manipulations.
static ByteBuffer newDirectByteBuffer(final int numElements)
Allocates a new direct ByteBuffer with the specified number of elements.
static final int SIZEOF_LONG
final void setLongAt(final int byteOffset, final long v)
Puts a long at the specified byteOffset.
final long getLongAt(final int byteOffset)
Retrieves the long at the specified byteOffset.
static void main(final String args[])
void testStructAccessorEndian1()
Machine data description for alignment and size onle, see com.jogamp.gluegen.
StringBuilder toString(StringBuilder sb)