Search in sources :

Example 1 with BundleReader

use of com.google.firebase.firestore.bundle.BundleReader in project firebase-android-sdk by firebase.

the class FirestoreClient method loadBundle.

public void loadBundle(InputStream bundleData, LoadBundleTask resultTask) {
    verifyNotTerminated();
    BundleReader bundleReader = new BundleReader(bundleSerializer, bundleData);
    asyncQueue.enqueueAndForget(() -> syncEngine.loadBundle(bundleReader, resultTask));
}
Also used : BundleReader(com.google.firebase.firestore.bundle.BundleReader)

Example 2 with BundleReader

use of com.google.firebase.firestore.bundle.BundleReader in project firebase-android-sdk by firebase.

the class SpecTestCase method doLoadBundle.

private void doLoadBundle(String json) throws Exception {
    BundleReader bundleReader = new BundleReader(new BundleSerializer(new RemoteSerializer(databaseInfo.getDatabaseId())), new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)));
    LoadBundleTask bundleTask = new LoadBundleTask();
    queue.runSync(() -> {
        syncEngine.loadBundle(bundleReader, bundleTask);
        bundleTask.addOnFailureListener(e -> log("Loading bundle failed with " + e));
    });
    assertTrue(bundleTask.isSuccessful());
}
Also used : BundleSerializer(com.google.firebase.firestore.bundle.BundleSerializer) ByteArrayInputStream(java.io.ByteArrayInputStream) RemoteSerializer(com.google.firebase.firestore.remote.RemoteSerializer) LoadBundleTask(com.google.firebase.firestore.LoadBundleTask) BundleReader(com.google.firebase.firestore.bundle.BundleReader)

Aggregations

BundleReader (com.google.firebase.firestore.bundle.BundleReader)2 LoadBundleTask (com.google.firebase.firestore.LoadBundleTask)1 BundleSerializer (com.google.firebase.firestore.bundle.BundleSerializer)1 RemoteSerializer (com.google.firebase.firestore.remote.RemoteSerializer)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1