public struct Blob : IEquatable<Blob>Reference documentation and code samples for the Firestore API struct Blob.
An immutable sequence of bytes.
Implements
IEquatableBlobNamespace
Google.Cloud.FirestoreAssembly
Google.Cloud.Firestore.dll
Remarks
Although this is a struct, it's effectively just a wrapper around a Protobuf ByteString.
default(Blob) acts as if it had been constructed with Empty.
Properties
ByteString
public ByteString ByteString { get; }The underlying Protobuf ByteString.
| Property Value | |
|---|---|
| Type | Description |
ByteString |
|
this[int]
public byte this[int index] { get; }Returns the byte at index index.
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index in the blob to return. Must be greater than or equal to 0, and less than Length. |
| Property Value | |
|---|---|
| Type | Description |
byte |
The byte at index |
Length
public int Length { get; }The length of the blob, in bytes.
| Property Value | |
|---|---|
| Type | Description |
int |
|
Methods
CopyFrom(byte[])
public static Blob CopyFrom(byte[] bytes)Constructs a new Blob by copying the current content of bytes.
| Parameter | |
|---|---|
| Name | Description |
bytes |
byteByte array to copy. |
| Returns | |
|---|---|
| Type | Description |
Blob |
A new blob containing a copy of |
FromByteString(ByteString)
public static Blob FromByteString(ByteString byteString)Constructs a new Blob wrapping the given ByteString.
| Parameter | |
|---|---|
| Name | Description |
byteString |
ByteStringThe ByteString to wrap. Must not be null. |
| Returns | |
|---|---|
| Type | Description |
Blob |
A new blob wrapping |
GetHashCode()
public override int GetHashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
ToString()
public override string ToString()| Returns | |
|---|---|
| Type | Description |
string |
|
Operators
operator ==(Blob, Blob)
public static bool operator ==(Blob lhs, Blob rhs)Operator overload to compare two Blob values for equality.
| Parameters | |
|---|---|
| Name | Description |
lhs |
BlobLeft value to compare |
rhs |
BlobRight value to compare |
| Returns | |
|---|---|
| Type | Description |
bool |
true if |
operator !=(Blob, Blob)
public static bool operator !=(Blob lhs, Blob rhs)Operator overload to compare two Blob values for inequality.
| Parameters | |
|---|---|
| Name | Description |
lhs |
BlobLeft value to compare |
rhs |
BlobRight value to compare |
| Returns | |
|---|---|
| Type | Description |
bool |
false if |