当前位置: 首页>>代码示例>>Java>>正文


Java BackupDataInputStream类代码示例

本文整理汇总了Java中android.app.backup.BackupDataInputStream的典型用法代码示例。如果您正苦于以下问题:Java BackupDataInputStream类的具体用法?Java BackupDataInputStream怎么用?Java BackupDataInputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BackupDataInputStream类属于android.app.backup包,在下文中一共展示了BackupDataInputStream类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
@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();
}
 
开发者ID:mathisdt,项目名称:trackworktime,代码行数:17,代码来源:DbBackupHelper.java

示例2: readData

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:19,代码来源:SipProfilesHelper.java

示例3: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
/**
 * 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, "-------------------------------------------------");
}
 
开发者ID:gabuzomeu,项目名称:geoPingProject,代码行数:13,代码来源:TestSharedPreferencesBackupHelper.java

示例4: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
@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, "-------------------------------------------------");
}
 
开发者ID:gabuzomeu,项目名称:geoPingProject,代码行数:13,代码来源:AbstractDbBackupHelper.java

示例5: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
@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();
    }
}
 
开发者ID:aulanov,项目名称:altidroid,代码行数:13,代码来源:DatabaseBackupHelper.java

示例6: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
@Override
public void restoreEntity(BackupDataInputStream data) {
    if (mRestoreEnabled) {
        super.restoreEntity(data);
    }
}
 
开发者ID:Phonemetra,项目名称:TurboLauncher,代码行数:7,代码来源:LauncherPreferencesBackupHelper.java

示例7: restoreEntity

import android.app.backup.BackupDataInputStream; //导入依赖的package包/类
@Override
public void restoreEntity(BackupDataInputStream data) {
    stopContentProvider();
    super.restoreEntity(data);
}
 
开发者ID:thomashaertel,项目名称:android-device-identification,代码行数:6,代码来源:CarefulDatabaseBackupHelper.java


注:本文中的android.app.backup.BackupDataInputStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。