Class Blob (3.7.3)

public final class Blob implements Serializable

Immutable class representing an array of bytes in Firestore.

Inheritance

Object > Blob

Implements

Serializable

Static Methods

fromByteString(ByteString byteString)

public static Blob fromByteString(ByteString byteString)

Creates a new Blob instance from the provided ByteString.

Parameter
NameDescription
byteStringByteString

The byteString to use for this Blob instance.

Returns
TypeDescription
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
NameDescription
bytesbyte[]

The bytes to use for this Blob instance.

Returns
TypeDescription
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
NameDescription
objObject

The object to compare against.

Returns
TypeDescription
boolean

Whether this Blob is equal to the provided object.

Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toByteString()

public ByteString toByteString()

Returns the backing data as a ByteString.

Returns
TypeDescription
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
TypeDescription
byte[]

The bytes of this blob as a byte[] array.