Example usage for android.app.backup BackupDataInputStream size

List of usage examples for android.app.backup BackupDataInputStream size

Introduction

In this page you can find the example usage for android.app.backup BackupDataInputStream size.

Prototype

public int size() 

Source Link

Document

Report the total number of bytes of data available for the current entity.

Usage

From source file:com.csipsimple.backup.SipProfilesHelper.java

/**
 * Read data from the input stream/* w w  w.  j a  va 2  s  .com*/
 * 
 * @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;
}