Package org.robolectric.shadows
Class ShadowParcel
- java.lang.Object
-
- org.robolectric.shadows.ShadowParcel
-
@Implements(value=android.os.Parcel.class, looseSignatures=true) public class ShadowParcel extends Object
Robolectric'sParcel
pretends to be backed by a byte buffer, closely matchingParcel
's position, size, and capacity behavior. However, its internal pure-Java representation is strongly typed, to detect non-portable code and common testing mistakes. It may throwIllegalArgumentException
orIllegalStateException
for error-prone behavior normalParcel
tolerates.
-
-
Constructor Summary
Constructors Constructor Description ShadowParcel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
nativeAppendFrom(int thisNativePtr, int otherNativePtr, int offset, int length)
protected static void
nativeAppendFrom(long thisNativePtr, long otherNativePtr, int offset, int length)
static Number
nativeCreate()
static byte[]
nativeCreateByteArray(int nativePtr)
protected static byte[]
nativeCreateByteArray(long nativePtr)
static int
nativeDataAvail(int nativePtr)
protected static int
nativeDataAvail(long nativePtr)
static int
nativeDataCapacity(int nativePtr)
protected static int
nativeDataCapacity(long nativePtr)
static int
nativeDataPosition(int nativePtr)
protected static int
nativeDataPosition(long nativePtr)
static int
nativeDataSize(int nativePtr)
protected static int
nativeDataSize(long nativePtr)
static void
nativeDestroy(int nativePtr)
protected static void
nativeDestroy(long nativePtr)
static void
nativeEnforceInterface(int nativePtr, String interfaceName)
protected static void
nativeEnforceInterface(long nativePtr, String interfaceName)
static void
nativeFreeBuffer(int nativePtr)
protected static void
nativeFreeBuffer(long nativePtr)
static byte[]
nativeMarshall(int nativePtr)
protected static byte[]
nativeMarshall(long nativePtr)
protected static byte[]
nativeReadBlob(long nativePtr)
protected static boolean
nativeReadByteArray(long nativePtr, byte[] dest, int destLen)
static double
nativeReadDouble(int nativePtr)
protected static double
nativeReadDouble(long nativePtr)
protected static FileDescriptor
nativeReadFileDescriptor(long nativePtr)
static float
nativeReadFloat(int nativePtr)
protected static float
nativeReadFloat(long nativePtr)
static int
nativeReadInt(int nativePtr)
protected static int
nativeReadInt(long nativePtr)
static long
nativeReadLong(int nativePtr)
protected static long
nativeReadLong(long nativePtr)
static String
nativeReadString(int nativePtr)
protected static String
nativeReadString(long nativePtr)
protected static String
nativeReadString16(long nativePtr)
protected static String
nativeReadString8(long nativePtr)
protected static IBinder
nativeReadStrongBinder(int nativePtr)
protected static IBinder
nativeReadStrongBinder(long nativePtr)
static void
nativeSetDataCapacity(int nativePtr, int size)
protected static void
nativeSetDataCapacity(long nativePtr, int size)
static void
nativeSetDataPosition(int nativePtr, int pos)
protected static void
nativeSetDataPosition(long nativePtr, int pos)
static void
nativeSetDataSize(int nativePtr, int size)
protected static void
nativeSetDataSize(long nativePtr, int size)
static void
nativeUnmarshall(int nativePtr, byte[] data, int offset, int length)
protected static void
nativeUnmarshall(long nativePtr, byte[] data, int offset, int length)
protected static void
nativeWriteBlob(long nativePtr, byte[] b, int offset, int len)
static void
nativeWriteByteArray(int nativePtr, byte[] b, int offset, int len)
protected static void
nativeWriteByteArray(long nativePtr, byte[] b, int offset, int len)
static void
nativeWriteDouble(int nativePtr, double val)
protected static void
nativeWriteDouble(long nativePtr, double val)
protected static int
nativeWriteDouble(Object nativePtr, Object val)
protected static long
nativeWriteFileDescriptor(long nativePtr, FileDescriptor val)
protected static void
nativeWriteFileDescriptor(Object nativePtr, Object val)
static void
nativeWriteFloat(int nativePtr, float val)
protected static void
nativeWriteFloat(long nativePtr, float val)
protected static int
nativeWriteFloat(Object nativePtr, Object val)
static void
nativeWriteInt(int nativePtr, int val)
protected static void
nativeWriteInt(long nativePtr, int val)
protected static int
nativeWriteInt(Object nativePtr, Object val)
static void
nativeWriteInterfaceToken(int nativePtr, String interfaceName)
protected static void
nativeWriteInterfaceToken(long nativePtr, String interfaceName)
static void
nativeWriteLong(int nativePtr, long val)
protected static void
nativeWriteLong(long nativePtr, long val)
protected static int
nativeWriteLong(Object nativePtr, Object val)
static void
nativeWriteString(int nativePtr, String val)
protected static void
nativeWriteString(long nativePtr, String val)
protected static void
nativeWriteString16(long nativePtr, String val)
protected static void
nativeWriteString8(long nativePtr, String val)
protected static void
nativeWriteStrongBinder(int nativePtr, IBinder val)
protected static void
nativeWriteStrongBinder(long nativePtr, IBinder val)
protected static FileDescriptor
openFileDescriptor(String file, int mode)
protected <T extends Parcelable>
TreadParcelable(ClassLoader loader)
Parcelable.Creator<?>
readParcelableCreator(ClassLoader loader)
protected void
writeBlob(byte[] b, int offset, int len)
protected void
writeByteArray(byte[] b, int offset, int len)
-
-
-
Method Detail
-
readParcelable
@Implementation(maxSdk=17) protected <T extends Parcelable> T readParcelable(ClassLoader loader)
-
readParcelableCreator
@HiddenApi @Implementation(minSdk=18) public Parcelable.Creator<?> readParcelableCreator(ClassLoader loader)
-
writeByteArray
@Implementation protected void writeByteArray(byte[] b, int offset, int len)
-
nativeDataSize
@HiddenApi @Implementation(maxSdk=20) public static int nativeDataSize(int nativePtr)
-
nativeDataSize
@Implementation(minSdk=21) protected static int nativeDataSize(long nativePtr)
-
nativeDataAvail
@HiddenApi @Implementation(maxSdk=20) public static int nativeDataAvail(int nativePtr)
-
nativeDataAvail
@Implementation(minSdk=21) protected static int nativeDataAvail(long nativePtr)
-
nativeDataPosition
@HiddenApi @Implementation(maxSdk=20) public static int nativeDataPosition(int nativePtr)
-
nativeDataPosition
@Implementation(minSdk=21) protected static int nativeDataPosition(long nativePtr)
-
nativeDataCapacity
@HiddenApi @Implementation(maxSdk=20) public static int nativeDataCapacity(int nativePtr)
-
nativeDataCapacity
@Implementation(minSdk=21) protected static int nativeDataCapacity(long nativePtr)
-
nativeSetDataSize
@HiddenApi @Implementation(maxSdk=20) public static void nativeSetDataSize(int nativePtr, int size)
-
nativeSetDataSize
@Implementation(minSdk=21) protected static void nativeSetDataSize(long nativePtr, int size)
-
nativeSetDataPosition
@HiddenApi @Implementation(maxSdk=20) public static void nativeSetDataPosition(int nativePtr, int pos)
-
nativeSetDataPosition
@Implementation(minSdk=21) protected static void nativeSetDataPosition(long nativePtr, int pos)
-
nativeSetDataCapacity
@HiddenApi @Implementation(maxSdk=20) public static void nativeSetDataCapacity(int nativePtr, int size)
-
nativeSetDataCapacity
@Implementation(minSdk=21) protected static void nativeSetDataCapacity(long nativePtr, int size)
-
nativeWriteByteArray
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteByteArray(int nativePtr, byte[] b, int offset, int len)
-
nativeWriteByteArray
@Implementation(minSdk=21) protected static void nativeWriteByteArray(long nativePtr, byte[] b, int offset, int len)
-
writeBlob
@Implementation(minSdk=23) protected void writeBlob(byte[] b, int offset, int len)
-
nativeWriteBlob
@Implementation(minSdk=21) protected static void nativeWriteBlob(long nativePtr, byte[] b, int offset, int len)
-
nativeWriteInt
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteInt(int nativePtr, int val)
-
nativeWriteInt
@Implementation(minSdk=21, maxSdk=30) protected static void nativeWriteInt(long nativePtr, int val)
-
nativeWriteLong
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteLong(int nativePtr, long val)
-
nativeWriteLong
@Implementation(minSdk=21, maxSdk=30) protected static void nativeWriteLong(long nativePtr, long val)
-
nativeWriteFloat
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteFloat(int nativePtr, float val)
-
nativeWriteFloat
@Implementation(minSdk=21, maxSdk=30) protected static void nativeWriteFloat(long nativePtr, float val)
-
nativeWriteDouble
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteDouble(int nativePtr, double val)
-
nativeWriteDouble
@Implementation(minSdk=21, maxSdk=30) protected static void nativeWriteDouble(long nativePtr, double val)
-
nativeWriteString
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteString(int nativePtr, String val)
-
nativeWriteString
@Implementation(minSdk=21, maxSdk=29) protected static void nativeWriteString(long nativePtr, String val)
-
nativeWriteStrongBinder
@HiddenApi @Implementation(maxSdk=20) protected static void nativeWriteStrongBinder(int nativePtr, IBinder val)
-
nativeWriteStrongBinder
@Implementation(minSdk=21) protected static void nativeWriteStrongBinder(long nativePtr, IBinder val)
-
nativeCreateByteArray
@HiddenApi @Implementation(maxSdk=20) public static byte[] nativeCreateByteArray(int nativePtr)
-
nativeCreateByteArray
@Implementation(minSdk=21) protected static byte[] nativeCreateByteArray(long nativePtr)
-
nativeReadBlob
@Implementation(minSdk=21) protected static byte[] nativeReadBlob(long nativePtr)
-
nativeReadByteArray
@Implementation(minSdk=27) protected static boolean nativeReadByteArray(long nativePtr, byte[] dest, int destLen)
-
nativeReadInt
@HiddenApi @Implementation(maxSdk=20) public static int nativeReadInt(int nativePtr)
-
nativeReadInt
@Implementation(minSdk=21) protected static int nativeReadInt(long nativePtr)
-
nativeReadLong
@HiddenApi @Implementation(maxSdk=20) public static long nativeReadLong(int nativePtr)
-
nativeReadLong
@Implementation(minSdk=21) protected static long nativeReadLong(long nativePtr)
-
nativeReadFloat
@HiddenApi @Implementation(maxSdk=20) public static float nativeReadFloat(int nativePtr)
-
nativeReadFloat
@Implementation(minSdk=21) protected static float nativeReadFloat(long nativePtr)
-
nativeReadDouble
@HiddenApi @Implementation(maxSdk=20) public static double nativeReadDouble(int nativePtr)
-
nativeReadDouble
@Implementation(minSdk=21) protected static double nativeReadDouble(long nativePtr)
-
nativeReadString
@HiddenApi @Implementation(maxSdk=20) public static String nativeReadString(int nativePtr)
-
nativeReadString
@Implementation(minSdk=21, maxSdk=29) protected static String nativeReadString(long nativePtr)
-
nativeReadStrongBinder
@HiddenApi @Implementation(maxSdk=20) protected static IBinder nativeReadStrongBinder(int nativePtr)
-
nativeReadStrongBinder
@Implementation(minSdk=21) protected static IBinder nativeReadStrongBinder(long nativePtr)
-
nativeCreate
@Implementation @HiddenApi public static Number nativeCreate()
-
nativeFreeBuffer
@HiddenApi @Implementation(maxSdk=20) public static void nativeFreeBuffer(int nativePtr)
-
nativeFreeBuffer
@Implementation(minSdk=21) protected static void nativeFreeBuffer(long nativePtr)
-
nativeDestroy
@HiddenApi @Implementation(maxSdk=20) public static void nativeDestroy(int nativePtr)
-
nativeDestroy
@Implementation(minSdk=21) protected static void nativeDestroy(long nativePtr)
-
nativeMarshall
@HiddenApi @Implementation(maxSdk=20) public static byte[] nativeMarshall(int nativePtr)
-
nativeMarshall
@Implementation(minSdk=21) protected static byte[] nativeMarshall(long nativePtr)
-
nativeUnmarshall
@HiddenApi @Implementation(maxSdk=20) public static void nativeUnmarshall(int nativePtr, byte[] data, int offset, int length)
-
nativeUnmarshall
@Implementation(minSdk=21) protected static void nativeUnmarshall(long nativePtr, byte[] data, int offset, int length)
-
nativeAppendFrom
@HiddenApi @Implementation(maxSdk=20) public static void nativeAppendFrom(int thisNativePtr, int otherNativePtr, int offset, int length)
-
nativeAppendFrom
@Implementation(minSdk=21) protected static void nativeAppendFrom(long thisNativePtr, long otherNativePtr, int offset, int length)
-
nativeWriteInterfaceToken
@HiddenApi @Implementation(maxSdk=20) public static void nativeWriteInterfaceToken(int nativePtr, String interfaceName)
-
nativeWriteInterfaceToken
@Implementation(minSdk=21) protected static void nativeWriteInterfaceToken(long nativePtr, String interfaceName)
-
nativeEnforceInterface
@HiddenApi @Implementation(maxSdk=20) public static void nativeEnforceInterface(int nativePtr, String interfaceName)
-
nativeEnforceInterface
@Implementation(minSdk=21) protected static void nativeEnforceInterface(long nativePtr, String interfaceName)
-
openFileDescriptor
@Implementation(maxSdk=28) protected static FileDescriptor openFileDescriptor(String file, int mode) throws IOException
- Throws:
IOException
-
nativeWriteFileDescriptor
@Implementation(minSdk=23, maxSdk=30) protected static long nativeWriteFileDescriptor(long nativePtr, FileDescriptor val)
-
nativeReadFileDescriptor
@Implementation(minSdk=23) protected static FileDescriptor nativeReadFileDescriptor(long nativePtr)
-
nativeWriteString8
@Implementation(minSdk=30) protected static void nativeWriteString8(long nativePtr, String val)
-
nativeWriteString16
@Implementation(minSdk=30) protected static void nativeWriteString16(long nativePtr, String val)
-
nativeReadString8
@Implementation(minSdk=30) protected static String nativeReadString8(long nativePtr)
-
nativeReadString16
@Implementation(minSdk=30) protected static String nativeReadString16(long nativePtr)
-
nativeWriteInt
@Implementation(minSdk=31) protected static int nativeWriteInt(Object nativePtr, Object val)
-
nativeWriteLong
@Implementation(minSdk=31) protected static int nativeWriteLong(Object nativePtr, Object val)
-
nativeWriteFloat
@Implementation(minSdk=31) protected static int nativeWriteFloat(Object nativePtr, Object val)
-
nativeWriteDouble
@Implementation(minSdk=31) protected static int nativeWriteDouble(Object nativePtr, Object val)
-
nativeWriteFileDescriptor
@Implementation(minSdk=31) protected static void nativeWriteFileDescriptor(Object nativePtr, Object val)
-
-