Blob

public classBlob implementsComparable


Immutable class representing an array of bytes in Cloud Firestore.

Summary

Public methods

int
boolean
static @NonNullBlob
fromBytes(@NonNull byte[] bytes)

Creates a newBlob instance from the provided bytes.

int
@NonNull byte[]
@NonNullString

Public methods

compareTo

public int compareTo(@NonNullBlob other)

equals

public boolean equals(@NullableObject other)

fromBytes

public static @NonNullBlob fromBytes(@NonNull byte[] bytes)

Creates a newBlob instance from the provided bytes. Will make a copy of the bytes passed in.

Parameters
@NonNull byte[] bytes

The bytes to use for thisBlob instance.

Returns
@NonNullBlob

The newBlob instance

hashCode

public int hashCode()

toBytes

public @NonNull byte[] toBytes()
Returns
@NonNull byte[]

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

toString

public @NonNullString toString()

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.