Package com.google.cloud.firestore
Class Blob
java.lang.Object
com.google.cloud.firestore.Blob
- All Implemented Interfaces:
Serializable
Immutable class representing an array of bytes in Firestore.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this Blob is equal to the provided object.static BlobfromBytes(byte[] bytes) Creates a new Blob instance from the provided bytes.static BlobfromByteString(com.google.protobuf.ByteString byteString) Creates a new Blob instance from the provided ByteString.inthashCode()byte[]toBytes()Returns a copy of the underlying bytes as a byte[] array.com.google.protobuf.ByteStringReturns the backing data as a ByteString.
-
Method Details
-
fromByteString
Creates a new Blob instance from the provided ByteString.- Parameters:
byteString- The byteString to use for this Blob instance.- Returns:
- The new Blob instance
-
fromBytes
Creates a new Blob instance from the provided bytes. Makes a copy of the bytes passed in.- Parameters:
bytes- The bytes to use for this Blob instance.- Returns:
- The new Blob instance
-
toByteString
Returns the backing data as a ByteString.- Returns:
- The bytes of this blob as a byteString
-
toBytes
Returns a copy of the underlying bytes as a byte[] array.- Returns:
- The bytes of this blob as a byte[] array.
-
equals
Returns true if this Blob is equal to the provided object. -
hashCode
public int hashCode()
-