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));
}
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());
}
Aggregations