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

下面列出了怎么用android.app.backup.BackupDataInputStream的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 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();
}
 
源代码2 项目: 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;
}
 
源代码3 项目: 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;
}
 
@Override
public void restoreEntity(BackupDataInputStream data) {
    if (mRestoreEnabled) {
        super.restoreEntity(data);
    }
}
 
@Override
public void restoreEntity(BackupDataInputStream data) {
    stopContentProvider();
    super.restoreEntity(data);
}
 
 类所在包
 类方法
 同包方法