/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.os; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileDescriptor; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass; import java.io.Serializable; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; public final class Parcel { /** * Retrieve a new Parcel object from the pool. */ public static Parcel obtain() { return null; } /** * Write a byte array into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. * * @param b Bytes to place into the parcel. */ public final void writeByteArray(byte[] b) { } /** * Write a byte array into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. * * @param b Bytes to place into the parcel. * @param offset Index of first byte to be written. * @param len Number of bytes to write. */ public final void writeByteArray(byte[] b, int offset, int len) { } /** * Write a blob of data into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. * * @param b Bytes to place into the parcel. {@hide} {@SystemApi} */ public final void writeBlob(byte[] b) { } /** * Write a blob of data into the parcel at the current {@link #dataPosition}, * growing {@link #dataCapacity} if needed. * * @param b Bytes to place into the parcel. * @param offset Index of first byte to be written. * @param len Number of bytes to write. {@hide} {@SystemApi} */ public final void writeBlob(byte[] b, int offset, int len) { } /** * Write an integer value into the parcel at the current dataPosition(), growing * dataCapacity() if needed. */ public final void writeInt(int val) { } /** * Write a long integer value into the parcel at the current dataPosition(), * growing dataCapacity() if needed. */ public final void writeLong(long val) { } /** * Write a floating point value into the parcel at the current dataPosition(), * growing dataCapacity() if needed. */ public final void writeFloat(float val) { } /** * Write a double precision floating point value into the parcel at the current * dataPosition(), growing dataCapacity() if needed. */ public final void writeDouble(double val) { } /** * Write a string value into the parcel at the current dataPosition(), growing * dataCapacity() if needed. */ public final void writeString(String val) { } /** * Write a string without going though a {@link ReadWriteHelper}. Subclasses of * {@link ReadWriteHelper} must use this method instead of {@link #writeString} * to avoid infinity recursive calls. * * @hide */ public void writeStringNoHelper(String val) { } /** @hide */ public final void writeBoolean(boolean val) { } /** * Write a CharSequence value into the parcel at the current dataPosition(), * growing dataCapacity() if needed. * * @hide */ public final void writeCharSequence(CharSequence val) { } /** * Write a byte value into the parcel at the current dataPosition(), growing * dataCapacity() if needed. */ public final void writeByte(byte val) { } /** * Please use {@link #writeBundle} instead. Flattens a Map into the parcel at * the current dataPosition(), growing dataCapacity() if needed. The Map keys * must be String objects. The Map values are written using {@link #writeValue} * and must follow the specification there. * *
* It is strongly recommended to use {@link #writeBundle} instead of this
* method, since the Bundle class provides a type-safe API that allows you to
* avoid mysterious type errors at the point of marshalling.
*/
public final void writeMap(Map val) {
}
/**
* Flatten a Bundle into the parcel at the current dataPosition(), growing
* dataCapacity() if needed.
*/
public final void writeBundle(Bundle val) {
}
/**
* Flatten a List into the parcel at the current dataPosition(), growing
* dataCapacity() if needed. The List values are written using
* {@link #writeValue} and must follow the specification there.
*/
public final void writeList(List val) {
}
/**
* Flatten an Object array into the parcel at the current dataPosition(),
* growing dataCapacity() if needed. The array values are written using
* {@link #writeValue} and must follow the specification there.
*/
public final void writeArray(Object[] val) {
}
public final void writeBooleanArray(boolean[] val) {
}
public final boolean[] createBooleanArray() {
return null;
}
public final void readBooleanArray(boolean[] val) {
}
public final void writeCharArray(char[] val) {
}
public final char[] createCharArray() {
return null;
}
public final void readCharArray(char[] val) {
}
public final void writeIntArray(int[] val) {
}
public final int[] createIntArray() {
return null;
}
public final void readIntArray(int[] val) {
}
public final void writeLongArray(long[] val) {
}
public final long[] createLongArray() {
return null;
}
public final void readLongArray(long[] val) {
}
public final void writeFloatArray(float[] val) {
}
public final float[] createFloatArray() {
return null;
}
public final void readFloatArray(float[] val) {
}
public final void writeDoubleArray(double[] val) {
}
public final double[] createDoubleArray() {
return null;
}
public final void readDoubleArray(double[] val) {
}
public final void writeStringArray(String[] val) {
}
public final String[] createStringArray() {
return null;
}
public final void readStringArray(String[] val) {
}
/**
* @hide
*/
public final void writeCharSequenceArray(CharSequence[] val) {
}
/**
* @hide
*/
public final void writeCharSequenceList(ArrayList
* {@link Parcelable} objects are written with {@link Parcelable#writeToParcel}
* using contextual flags of 0. When serializing objects containing
* {@link ParcelFileDescriptor}s, this may result in file descriptor leaks when
* they are returned from Binder calls (where
* {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE} should be used).
*
* The supported exception types are:
*
*
*
*
*
*
* @param e The Exception to be written.
*
* @see #writeNoException
* @see #readException
*/
public final void writeException(Exception e) {
}
/**
* Special function for writing information at the front of the Parcel
* indicating that no exception occurred.
*
* @see #writeException
* @see #readException
*/
public final void writeNoException() {
}
/**
* Special function for reading an exception result from the header of a parcel,
* to be used after receiving the result of a transaction. This will throw the
* exception for you if it had been written to the Parcel, otherwise return and
* let you read the normal result data from the Parcel.
*
* @see #writeException
* @see #writeNoException
*/
public final void readException() {
}
/**
* Parses the header of a Binder call's response Parcel and returns the
* exception code. Deals with lite or fat headers. In the common successful
* case, this header is generally zero. In less common cases, it's a small
* negative number and will be followed by an error string.
*
* This exists purely for android.database.DatabaseUtils and insulating it from
* having to handle fat headers as returned by e.g. StrictMode-induced RPC
* responses.
*
* @hide
*/
public final int readExceptionCode() {
return -1;
}
/**
* Throw an exception with the given message. Not intended for use outside the
* Parcel class.
*
* @param code Used to determine which exception class to throw.
* @param msg The exception message.
*/
public final void readException(int code, String msg) {
}
/**
* Read an integer value from the parcel at the current dataPosition().
*/
public final int readInt() {
return -1;
}
/**
* Read a long integer value from the parcel at the current dataPosition().
*/
public final long readLong() {
return -1;
}
/**
* Read a floating point value from the parcel at the current dataPosition().
*/
public final float readFloat() {
return -1;
}
/**
* Read a double precision floating point value from the parcel at the current
* dataPosition().
*/
public final double readDouble() {
return -1;
}
/**
* Read a string value from the parcel at the current dataPosition().
*/
public final String readString() {
return null;
}
/** @hide */
public final boolean readBoolean() {
return false;
}
/**
* Read a CharSequence value from the parcel at the current dataPosition().
*
* @hide
*/
public final CharSequence readCharSequence() {
return null;
}
/**
* Read a byte value from the parcel at the current dataPosition().
*/
public final byte readByte() {
return -1;
}
/**
* Please use {@link #readBundle(ClassLoader)} instead (whose data must have
* been written with {@link #writeBundle}. Read into an existing Map object from
* the parcel at the current dataPosition().
*/
public final void readMap(Map outVal, ClassLoader loader) {
}
/**
* Read into an existing List object from the parcel at the current
* dataPosition(), using the given class loader to load any enclosed
* Parcelables. If it is null, the default class loader is used.
*/
public final void readList(List outVal, ClassLoader loader) {
}
/**
* Please use {@link #readBundle(ClassLoader)} instead (whose data must have
* been written with {@link #writeBundle}. Read and return a new HashMap object
* from the parcel at the current dataPosition(), using the given class loader
* to load any enclosed Parcelables. Returns null if the previously written map
* object was null.
*/
public final HashMap readHashMap(ClassLoader loader) {
return null;
}
/**
* Read and return a new Bundle object from the parcel at the current
* dataPosition(). Returns null if the previously written Bundle object was
* null.
*/
public final Bundle readBundle() {
return null;
}
/**
* Read and return a new Bundle object from the parcel at the current
* dataPosition(), using the given class loader to initialize the class loader
* of the Bundle for later retrieval of Parcelable objects. Returns null if the
* previously written Bundle object was null.
*/
public final Bundle readBundle(ClassLoader loader) {
return null;
}
/**
* Read and return a byte[] object from the parcel.
*/
public final byte[] createByteArray() {
return null;
}
/**
* Read a byte[] object from the parcel and copy it into the given byte array.
*/
public final void readByteArray(byte[] val) {
}
/**
* Read a blob of data from the parcel and return it as a byte array.
* {@hide} {@SystemApi}
*/
public final byte[] readBlob() {
return null;
}
/**
* Read and return a String[] object from the parcel. {@hide}
*/
public final String[] readStringArray() {
return null;
}
/**
* Read and return a CharSequence[] object from the parcel. {@hide}
*/
public final CharSequence[] readCharSequenceArray() {
return null;
}
/**
* Read and return an ArrayList<CharSequence> object from the parcel.
* {@hide}
*/
public final ArrayList