com.google.appengine.api.datastore.ShortBlob

Here are the examples of the java api class com.google.appengine.api.datastore.ShortBlob taken from open source projects.

1. ValueTranslationTests#shortBlobsAreConvertedToByteArrays()

View license
/** */
@Test
public void shortBlobsAreConvertedToByteArrays() throws Exception {
    fact().register(Blobby.class);
    final Entity ent = new Entity("Blobby");
    final ShortBlob shortBlob = new ShortBlob(new byte[] { 1, 2, 3 });
    ent.setProperty("stuff", shortBlob);
    final Key<Blobby> blobbyKey = Key.create(ds().put(ent));
    final Blobby blobby = ofy().load().key(blobbyKey).safe();
    assert Arrays.equals(blobby.stuff, shortBlob.getBytes());
}