Class Blob (3.28.0)

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
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.

Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

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.