summaryrefslogtreecommitdiffstats
path: root/core/java/android/backup/BackupDataInput.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-06-16 16:31:35 -0400
committerJoe Onorato <joeo@android.com>2009-06-16 18:46:50 -0700
commit5f15d151b5101fadfe6cba1e8f4aa6367e8c603e (patch)
tree3a94295ffc2935c7ca1550c01a6e793766bf415f /core/java/android/backup/BackupDataInput.java
parentaa088447baadd2e0bbcfd18cc529645610c13ddc (diff)
downloadframeworks_base-5f15d151b5101fadfe6cba1e8f4aa6367e8c603e.zip
frameworks_base-5f15d151b5101fadfe6cba1e8f4aa6367e8c603e.tar.gz
frameworks_base-5f15d151b5101fadfe6cba1e8f4aa6367e8c603e.tar.bz2
checkpoint BackupDatAInput / RestoreHelper
Diffstat (limited to 'core/java/android/backup/BackupDataInput.java')
-rw-r--r--core/java/android/backup/BackupDataInput.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/core/java/android/backup/BackupDataInput.java b/core/java/android/backup/BackupDataInput.java
index 609dd90..69c206c 100644
--- a/core/java/android/backup/BackupDataInput.java
+++ b/core/java/android/backup/BackupDataInput.java
@@ -82,9 +82,9 @@ public class BackupDataInput {
}
}
- public int readEntityData(byte[] data, int size) throws IOException {
+ public int readEntityData(byte[] data, int offset, int size) throws IOException {
if (mHeaderReady) {
- int result = readEntityData_native(mBackupReader, data, size);
+ int result = readEntityData_native(mBackupReader, data, offset, size);
if (result >= 0) {
return result;
} else {
@@ -95,9 +95,23 @@ public class BackupDataInput {
}
}
+ public void skipEntityData() throws IOException {
+ if (mHeaderReady) {
+ int result = skipEntityData_native(mBackupReader);
+ if (result >= 0) {
+ return;
+ } else {
+ throw new IOException("result=0x" + Integer.toHexString(result));
+ }
+ } else {
+ throw new IllegalStateException("mHeaderReady=false");
+ }
+ }
+
private native static int ctor(FileDescriptor fd);
private native static void dtor(int mBackupReader);
private native int readNextHeader_native(int mBackupReader, EntityHeader entity);
- private native int readEntityData_native(int mBackupReader, byte[] data, int size);
+ private native int readEntityData_native(int mBackupReader, byte[] data, int offset, int size);
+ private native int skipEntityData_native(int mBackupReader);
}