package com.google.firebase.firestore;

import com.google.firebase.firestore.util.Preconditions;
import com.google.firebase.firestore.util.Util;
import com.google.protobuf.AbstractC1320n;
import com.google.protobuf.C1318m;

/* JADX INFO: loaded from: classes3.dex */
public class Blob implements Comparable<Blob> {
    private final AbstractC1320n bytes;

    private Blob(AbstractC1320n abstractC1320n) {
        this.bytes = abstractC1320n;
    }

    public static Blob fromByteString(AbstractC1320n abstractC1320n) {
        Preconditions.checkNotNull(abstractC1320n, "Provided ByteString must not be null.");
        return new Blob(abstractC1320n);
    }

    public static Blob fromBytes(byte[] bArr) {
        Preconditions.checkNotNull(bArr, "Provided bytes array must not be null.");
        C1318m c1318m = AbstractC1320n.f14310b;
        return new Blob(AbstractC1320n.l(bArr, 0, bArr.length));
    }

    public boolean equals(Object obj) {
        return (obj instanceof Blob) && this.bytes.equals(((Blob) obj).bytes);
    }

    public int hashCode() {
        return this.bytes.hashCode();
    }

    public AbstractC1320n toByteString() {
        return this.bytes;
    }

    public byte[] toBytes() {
        return this.bytes.x();
    }

    public String toString() {
        return "Blob { bytes=" + Util.toDebugString(this.bytes) + " }";
    }

    @Override // java.lang.Comparable
    public int compareTo(Blob blob) {
        return Util.compareByteStrings(this.bytes, blob.bytes);
    }
}
