public final class Blob implements Serializable
Immutable class representing an array of bytes in Firestore.
Implements
SerializableStatic Methods
fromByteString(ByteString byteString)
public static Blob fromByteString(ByteString byteString)
Creates a new Blob instance from the provided ByteString.
Parameter | |
---|---|
Name | Description |
byteString |
ByteString The byteString to use for this Blob instance. |
Returns | |
---|---|
Type | Description |
Blob |
The new Blob instance |
fromBytes(byte[] bytes)
public static Blob fromBytes(byte[] bytes)
Creates a new Blob instance from the provided bytes. Makes a copy of the bytes passed in.
Parameter | |
---|---|
Name | Description |
bytes |
byte[] The bytes to use for this Blob instance. |
Returns | |
---|---|
Type | Description |
Blob |
The new Blob instance |
Methods
equals(Object obj)
public boolean equals(Object obj)
Returns true if this Blob is equal to the provided object.
Parameter | |
---|---|
Name | Description |
obj |
Object The object to compare against. |
Returns | |
---|---|
Type | Description |
boolean |
Whether this Blob is equal to the provided object. |
hashCode()
public int hashCode()
Returns | |
---|---|
Type | Description |
int |
toByteString()
public ByteString toByteString()
Returns the backing data as a ByteString.
Returns | |
---|---|
Type | Description |
ByteString |
The bytes of this blob as a byteString |
toBytes()
public byte[] toBytes()
Returns a copy of the underlying bytes as a byte[] array.
Returns | |
---|---|
Type | Description |
byte[] |
The bytes of this blob as a byte[] array. |