@Implements(value=android.os.SharedMemory.class, minSdk=27, isInAndroidSdk=false) public class ShadowSharedMemory extends java.lang.Object
This is not a faithful “shared” memory implementation. Since Robolectric tests only operate within a single process, this shadow just allocates an in-process memory chunk.
Constructor and Description |
---|
ShadowSharedMemory() |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
map(int prot,
int offset,
int length)
For tests, returns a
ByteBuffer of the requested size. |
static java.io.FileDescriptor |
nCreate(java.lang.String name,
int size) |
static int |
nGetSize(java.io.FileDescriptor fd) |
@Implementation public java.nio.ByteBuffer map(int prot, int offset, int length) throws android.system.ErrnoException
For tests, returns a ByteBuffer
of the requested size.
android.system.ErrnoException
@Implementation public static java.io.FileDescriptor nCreate(java.lang.String name, int size) throws android.system.ErrnoException
android.system.ErrnoException
@Implementation public static int nGetSize(java.io.FileDescriptor fd)