diff options
| author | Dan Sandler <dsandler@android.com> | 2015-05-01 17:57:13 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-01 17:57:14 +0000 |
| commit | 9fc943d1a69f2ab0f6d8285b09aef7e344a1fd1a (patch) | |
| tree | 0db0df2a76f3e993dcb3d23af55026c2ef322565 /core/java/android/os/Parcel.java | |
| parent | a7cba44a22ffdaccf5198bb83b73a31c78091978 (diff) | |
| parent | b9f7aac3488873677377b36c57338d758098f78e (diff) | |
| download | frameworks_base-9fc943d1a69f2ab0f6d8285b09aef7e344a1fd1a.zip frameworks_base-9fc943d1a69f2ab0f6d8285b09aef7e344a1fd1a.tar.gz frameworks_base-9fc943d1a69f2ab0f6d8285b09aef7e344a1fd1a.tar.bz2 | |
Merge "Icon: a clean, parcelable place for images." into mnc-dev
Diffstat (limited to 'core/java/android/os/Parcel.java')
| -rw-r--r-- | core/java/android/os/Parcel.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 8c1f44f..1273772 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -502,7 +502,25 @@ public final class Parcel { * {@SystemApi} */ public final void writeBlob(byte[] b) { - nativeWriteBlob(mNativePtr, b, 0, (b != null) ? b.length : 0); + writeBlob(b, 0, (b != null) ? b.length : 0); + } + + /** + * 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) { + if (b == null) { + writeInt(-1); + return; + } + Arrays.checkOffsetAndCount(b.length, offset, len); + nativeWriteBlob(mNativePtr, b, offset, len); } /** |
