Java 类android.app.backup.BackupDataInputStream 实例源码

项目:trackworktime    文件:DbBackupHelper.java   
@Override
public void restoreEntity(final BackupDataInputStream data) {
    final DAO dao = new DAO(context);

    if (KEY.equals(data.getKey())) {
        final BufferedReader reader = new BufferedReader(new InputStreamReader(data));

        try {
            dao.restoreFromReader(reader);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    dao.close();
}
项目:CSipSimple    文件:SipProfilesHelper.java   
/**
 * Read data from the input stream
 * 
 * @param data the input stream
 * @return the data
 * @throws IOException I/O error
 */
private String readData(BackupDataInputStream data) throws IOException {
    String dataS;
    byte[] buf = new byte[data.size()];
    data.read(buf, 0, buf.length);
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    DataInputStream dis = new DataInputStream(bais);
    dataS = dis.readUTF();
    dis.close();
    bais.close();
    return dataS;
}
项目:CSipSimple    文件:SipSharedPreferencesHelper.java   
/**
 * Read data from the input stream
 * 
 * @param data the input stream
 * @return the data
 * @throws IOException I/O error
 */
private String readData(BackupDataInputStream data) throws IOException {
    String dataS;
    byte[] buf = new byte[data.size()];
    data.read(buf, 0, buf.length);
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    DataInputStream dis = new DataInputStream(bais);
    dataS = dis.readUTF();
    dis.close();
    bais.close();
    return dataS;
}
项目:geoPingProject    文件:TestSharedPreferencesBackupHelper.java   
/**
 * Restores one entity from the restore data stream to its proper shared
 * preferences file store.
 */
public void restoreEntity(BackupDataInputStream data) {
    String key = data.getKey();
    Log.i(TAG, "-------------------------------------------------");
    Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());
    super.restoreEntity(data);
    Log.i(TAG, "----- restoreEntity End");
    Log.i(TAG, "-------------------------------------------------");
}
项目:geoPingProject    文件:AbstractDbBackupHelper.java   
@Override
public void restoreEntity(BackupDataInputStream data) {
    String key = data.getKey();
    Log.i(TAG, "-------------------------------------------------");
    Log.i(TAG, "--- restore Entity '" + key + "' size=" + data.size());

    if (backupKey.equals(key)) {
        readBackup(data);
    }
    Log.i(TAG, "----- restoreEntity End");
    Log.i(TAG, "-------------------------------------------------");
}
项目:altidroid    文件:DatabaseBackupHelper.java   
@Override
public void restoreEntity(BackupDataInputStream data) {
    byte[] buf = new byte[data.size()];
    try {
        data.read(buf);
        ContentValues values = mAdaptor.Unserialise(buf);
        mContext.getContentResolver().insert(mUri, values);
    } catch (IOException e) {
        Log.e("AltidroidBackup", "Unable to read backup value: " + data.getKey());
        e.printStackTrace();
    }
}
项目:TurboLauncher    文件:LauncherPreferencesBackupHelper.java   
@Override
public void restoreEntity(BackupDataInputStream data) {
    if (mRestoreEnabled) {
        super.restoreEntity(data);
    }
}
项目:android-device-identification    文件:CarefulDatabaseBackupHelper.java   
@Override
public void restoreEntity(BackupDataInputStream data) {
    stopContentProvider();
    super.restoreEntity(data);
}