Struct Blob
An immutable sequence of bytes.
Implements
Inherited Members
Namespace: Google.Cloud.Firestore
Assembly: Google.Cloud.Firestore.dll
Syntax
public struct Blob : IEquatable<Blob>
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
The underlying Protobuf ByteString.
Declaration
public ByteString ByteString { get; }
Property Value
Type | Description |
---|---|
ByteString |
this[int]
Returns the byte at index index
.
Declaration
public byte this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The 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
The length of the blob, in bytes.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
int |
Methods
CopyFrom(byte[])
Constructs a new Blob by copying the current content of bytes
.
Declaration
public static Blob CopyFrom(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | Byte array to copy. |
Returns
Type | Description |
---|---|
Blob | A new blob containing a copy of |
FromByteString(ByteString)
Constructs a new Blob wrapping the given ByteString.
Declaration
public static Blob FromByteString(ByteString byteString)
Parameters
Type | Name | Description |
---|---|---|
ByteString | byteString | The ByteString to wrap. Must not be null. |
Returns
Type | Description |
---|---|
Blob | A new blob wrapping |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Operators
operator ==(Blob, Blob)
Operator overload to compare two Blob values for equality.
Declaration
public static bool operator ==(Blob lhs, Blob rhs)
Parameters
Type | Name | Description |
---|---|---|
Blob | lhs | Left value to compare |
Blob | rhs | Right value to compare |
Returns
Type | Description |
---|---|
bool | true if |
operator !=(Blob, Blob)
Operator overload to compare two Blob values for inequality.
Declaration
public static bool operator !=(Blob lhs, Blob rhs)
Parameters
Type | Name | Description |
---|---|---|
Blob | lhs | Left value to compare |
Blob | rhs | Right value to compare |
Returns
Type | Description |
---|---|
bool | false if |