List of usage examples for android.app.backup BackupDataOutput writeEntityData
public int writeEntityData(byte[] data, int size) throws IOException
From source file:com.csipsimple.backup.SipProfilesHelper.java
private void writeData(BackupDataOutput data, String value) throws IOException { // Create buffer stream and data output stream for our data ByteArrayOutputStream bufStream = new ByteArrayOutputStream(); DataOutputStream outWriter = new DataOutputStream(bufStream); // Write structured data outWriter.writeUTF(value);/*from www .j ava 2 s.c o m*/ // Send the data to the Backup Manager via the BackupDataOutput byte[] buffer = bufStream.toByteArray(); int len = buffer.length; data.writeEntityHeader(ACCOUNTS_BACKUP_KEY, len); data.writeEntityData(buffer, len); }
From source file:com.csipsimple.backup.SipSharedPreferencesHelper.java
private void writeData(BackupDataOutput data, String value) throws IOException { // Create buffer stream and data output stream for our data ByteArrayOutputStream bufStream = new ByteArrayOutputStream(); DataOutputStream outWriter = new DataOutputStream(bufStream); // Write structured data outWriter.writeUTF(value);// w ww. jav a 2s. c om // Send the data to the Backup Manager via the BackupDataOutput byte[] buffer = bufStream.toByteArray(); int len = buffer.length; data.writeEntityHeader(SETTINGS_BACKUP_KEY, len); data.writeEntityData(buffer, len); }