@TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "", method = "setIntArray", args = {} ) public void testSetIntArray() { IMemorySystem memory = Platform.getMemorySystem(); int[] values = { 3, 7, 31, 127, 8191, 131071, 524287, 2147483647 }; int[] swappedValues = new int[values.length]; for (int i = 0; i < values.length; ++i) { swappedValues[i] = swapInt(values[i]); } int scale = ICommonDataTypes.SIZEOF_JINT; int ptr = memory.malloc(scale * values.length); try { memory.memset(ptr, (byte) 0, scale * values.length); memory.setIntArray(ptr, values, 0, values.length, false); assertIntsEqual(values, ptr); memory.memset(ptr, (byte) 0, scale * values.length); memory.setIntArray(ptr, values, 0, values.length, true); assertIntsEqual(swappedValues, ptr); memory.memset(ptr, (byte) 0, scale * values.length); for (int i = 0; i < values.length; ++i) { memory.setIntArray(ptr + i * scale, values, i, 1, true); } assertIntsEqual(swappedValues, ptr); } finally { memory.free(ptr); } }
public native void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException;
OSMemory implements IMemorySystem { public native void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException; }
OSMemory implements IMemorySystem { public native void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException; private  OSMemory(); }
OSMemory implements IMemorySystem { public native void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException; private  OSMemory(); static OSMemory getOSMemory(); boolean isLittleEndian(); Endianness getNativeOrder(); int getPointerSize(); native int malloc(int length); native void free(int address); native void memset(int address, byte value, long length); native void memmove(int destAddress, int srcAddress, long length); native void getByteArray(int address, byte[] bytes, int offset,
            int length); native void setByteArray(int address, byte[] bytes, int offset,
            int length); native void setShortArray(int address, short[] shorts, int offset,
            int length, boolean swap); native void setIntArray(int address, int[] ints, int offset,
            int length, boolean swap); native byte getByte(int address); native void setByte(int address, byte value); native short getShort(int address); short getShort(int address, Endianness endianness); native void setShort(int address, short value); void setShort(int address, short value, Endianness endianness); native int getInt(int address); int getInt(int address, Endianness endianness); native void setInt(int address, int value); void setInt(int address, int value, Endianness endianness); native long getLong(int address); long getLong(int address, Endianness endianness); native void setLong(int address, long value); void setLong(int address, long value, Endianness endianness); native float getFloat(int address); float getFloat(int address, Endianness endianness); native void setFloat(int address, float value); void setFloat(int address, float value, Endianness endianness); native double getDouble(int address); double getDouble(int address, Endianness endianness); native void setDouble(int address, double value); void setDouble(int address, double value, Endianness endianness); native int getAddress(int address); native void setAddress(int address, int value); int mmap(int fileDescriptor, long alignment, long size,
            int mapMode); void unmap(int addr, long size); void load(int addr, long size); boolean isLoaded(int addr, long size); void flush(int addr, long size); }
OSMemory implements IMemorySystem { public native void setIntArray(int address, int[] ints, int offset, int length, boolean swap) throws NullPointerException, IndexOutOfBoundsException; private  OSMemory(); static OSMemory getOSMemory(); boolean isLittleEndian(); Endianness getNativeOrder(); int getPointerSize(); native int malloc(int length); native void free(int address); native void memset(int address, byte value, long length); native void memmove(int destAddress, int srcAddress, long length); native void getByteArray(int address, byte[] bytes, int offset,
            int length); native void setByteArray(int address, byte[] bytes, int offset,
            int length); native void setShortArray(int address, short[] shorts, int offset,
            int length, boolean swap); native void setIntArray(int address, int[] ints, int offset,
            int length, boolean swap); native byte getByte(int address); native void setByte(int address, byte value); native short getShort(int address); short getShort(int address, Endianness endianness); native void setShort(int address, short value); void setShort(int address, short value, Endianness endianness); native int getInt(int address); int getInt(int address, Endianness endianness); native void setInt(int address, int value); void setInt(int address, int value, Endianness endianness); native long getLong(int address); long getLong(int address, Endianness endianness); native void setLong(int address, long value); void setLong(int address, long value, Endianness endianness); native float getFloat(int address); float getFloat(int address, Endianness endianness); native void setFloat(int address, float value); void setFloat(int address, float value, Endianness endianness); native double getDouble(int address); double getDouble(int address, Endianness endianness); native void setDouble(int address, double value); void setDouble(int address, double value, Endianness endianness); native int getAddress(int address); native void setAddress(int address, int value); int mmap(int fileDescriptor, long alignment, long size,
            int mapMode); void unmap(int addr, long size); void load(int addr, long size); boolean isLoaded(int addr, long size); void flush(int addr, long size); static final int POINTER_SIZE; static final Endianness NATIVE_ORDER; }