@Test public void testMutableBytes() { byte[] myBytes = {1, 2, 3}; Blob blob1 = Blob.fromBytes(myBytes); Blob blob2 = Blob.fromBytes(myBytes); myBytes[0] = 5; Blob blob3 = Blob.fromBytes(myBytes); assertEquals(blob1, blob2); assertNotEquals(blob1, blob3); }
@NonNull public static Blob fromBytes(@NonNull byte[] bytes) { checkNotNull(bytes, "Provided bytes array must not be null."); return new Blob(ByteString.copyFrom(bytes)); }
Blob implements Comparable<Blob> { @NonNull public static Blob fromBytes(@NonNull byte[] bytes) { checkNotNull(bytes, "Provided bytes array must not be null."); return new Blob(ByteString.copyFrom(bytes)); } }
Blob implements Comparable<Blob> { @NonNull public static Blob fromBytes(@NonNull byte[] bytes) { checkNotNull(bytes, "Provided bytes array must not be null."); return new Blob(ByteString.copyFrom(bytes)); } private  Blob(ByteString bytes); }
Blob implements Comparable<Blob> { @NonNull public static Blob fromBytes(@NonNull byte[] bytes) { checkNotNull(bytes, "Provided bytes array must not be null."); return new Blob(ByteString.copyFrom(bytes)); } private  Blob(ByteString bytes); @NonNull static Blob fromBytes(@NonNull byte[] bytes); @NonNull @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) static Blob fromByteString(@NonNull ByteString bytes); @NonNull byte[] toBytes(); @Override @NonNull String toString(); @NonNull @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) ByteString toByteString(); @Override boolean equals(@Nullable Object other); @Override int hashCode(); @Override int compareTo(@NonNull Blob other); }
Blob implements Comparable<Blob> { @NonNull public static Blob fromBytes(@NonNull byte[] bytes) { checkNotNull(bytes, "Provided bytes array must not be null."); return new Blob(ByteString.copyFrom(bytes)); } private  Blob(ByteString bytes); @NonNull static Blob fromBytes(@NonNull byte[] bytes); @NonNull @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) static Blob fromByteString(@NonNull ByteString bytes); @NonNull byte[] toBytes(); @Override @NonNull String toString(); @NonNull @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) ByteString toByteString(); @Override boolean equals(@Nullable Object other); @Override int hashCode(); @Override int compareTo(@NonNull Blob other);  }