Code example for BackupDataOutput

Methods: writeEntityDatawriteEntityHeader

        // Write structured data 
        // 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);
     * 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()];, 0, buf.length);
Connect your IDE to all the code out there  Get Codota for Java