@Implements(value=android.os.SharedMemory.class, minSdk=27, isInAndroidSdk=false) public class ShadowSharedMemory extends java.lang.Object
A SharedMemory
fake that uses a private temporary disk file for storage and Java’s MappedByteBuffer
for the memory mappings.
Constructor and Description |
---|
ShadowSharedMemory() |
Modifier and Type | Method and Description |
---|---|
protected java.nio.ByteBuffer |
map(int prot,
int offset,
int length)
Only works on
SharedMemory instances from SharedMemory.create(java.lang.String, int) . |
protected static java.io.FileDescriptor |
nCreate(java.lang.String name,
int size) |
protected static int |
nGetSize(java.io.FileDescriptor fd) |
protected static void |
unmap(java.nio.ByteBuffer mappedBuf) |
@Implementation protected java.nio.ByteBuffer map(int prot, int offset, int length) throws android.system.ErrnoException
Only works on SharedMemory
instances from SharedMemory.create(java.lang.String, int)
.
“prot” is ignored – all mappings are read/write.
android.system.ErrnoException
@Implementation protected static void unmap(java.nio.ByteBuffer mappedBuf) throws android.system.ErrnoException
android.system.ErrnoException
@Implementation protected static java.io.FileDescriptor nCreate(java.lang.String name, int size) throws android.system.ErrnoException
android.system.ErrnoException
@Implementation protected static int nGetSize(java.io.FileDescriptor fd)