Memory

Class of libcore.io · Memory.java

public final class Memory

ART's libcore.io.Memory, which native code and some libraries reach although it is hidden: reads and writes of memory by address (the native bridge's addresses are host addresses) and of byte arrays in a byte order. A shim of the ART internals that apps touch (docs/platforms/android-apps/interfaces.md).

Methods

public static byte peekByte(long address) source
public static void pokeByte(long address, byte value) source
public static short peekShort(long address, boolean swap) source

swap: the value's bytes in the other order than the host's

public static int peekInt(long address, boolean swap) source
public static long peekLong(long address, boolean swap) source
public static void pokeShort(long address, short value, boolean swap) source
public static void pokeInt(long address, int value, boolean swap) source
public static void pokeLong(long address, long value, boolean swap) source
public static void peekByteArray(long address, byte[] dst, int offset, int count) source
public static void pokeByteArray(long address, byte[] src, int offset, int count) source
public static short peekShort(byte[] src, int offset, ByteOrder order) source
public static int peekInt(byte[] src, int offset, ByteOrder order) source
public static long peekLong(byte[] src, int offset, ByteOrder order) source
public static void pokeShort(byte[] dst, int offset, short value, ByteOrder order) source
public static void pokeInt(byte[] dst, int offset, int value, ByteOrder order) source
public static void pokeLong(byte[] dst, int offset, long value, ByteOrder order) source
public static void memmove(Object dstObject, int dstOffset, Object srcObject, int srcOffset, long byteCount) source

byteCount bytes between two arrays (of any primitive type) at byte offsets


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.