Show / Hide Table of Contents

Class Blob

A class representing an arbitrary piece of binary data

Inheritance
System.Object
Blob
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Couchbase.Lite
Assembly: Couchbase.Lite.dll
Syntax
public sealed class Blob

Constructors

| Improve this Doc View Source

Blob(String, Byte[])

Creates a blob given a type and in memory content

Declaration
public Blob(string contentType, byte[] content)
Parameters
Type Name Description
System.String contentType

The binary type of the blob

System.Byte[] content

The content of the blob

Exceptions
Type Condition
System.ArgumentNullException

Thrown if content is null

| Improve this Doc View Source

Blob(String, Stream)

Creates a blob given a type and streaming content

Declaration
public Blob(string contentType, Stream stream)
Parameters
Type Name Description
System.String contentType

The binary type of the blob

System.IO.Stream stream

The stream containing the blob content

Exceptions
Type Condition
System.ArgumentNullException

Thrown if stream is null

| Improve this Doc View Source

Blob(String, Uri)

Creates an blob given a type and a URL to a file

Declaration
public Blob(string contentType, Uri fileUrl)
Parameters
Type Name Description
System.String contentType

The binary type of the blob

System.Uri fileUrl

The url to the file to read

Exceptions
Type Condition
System.ArgumentNullException

Thrown if fileUrl is null

System.ArgumentException

Thrown if fileUrl is not a file based URL

Properties

| Improve this Doc View Source

Content

Gets the contents of the blob as an in-memory array

Declaration
public byte[] Content { get; }
Property Value
Type Description
System.Byte[]
Exceptions
Type Condition
System.InvalidOperationException

Thrown if this blob has no associated data (unusual)

| Improve this Doc View Source

ContentStream

Gets the contents of the blob as a System.IO.Stream

Declaration
public Stream ContentStream { get; }
Property Value
Type Description
System.IO.Stream
Remarks

The caller is responsible for disposing the Stream when finished with it.

| Improve this Doc View Source

ContentType

Gets the content type of the blob

Declaration
public string ContentType { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Digest

Gets the digest of the blob, once it is saved

Declaration
public string Digest { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Length

Gets the length of the data that the blob contains

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Properties

Gets the metadata of the blob instance

Declaration
public IReadOnlyDictionary<string, object> Properties { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object>

Methods

| Improve this Doc View Source

Equals(Object)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare with the current object.

Returns
Type Description
System.Boolean

true if the specified object is equal to the current object; otherwise, false.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that represents the current object.

Overrides
System.Object.ToString()
  • Improve this Doc
  • View Source
Back to top Generated by DocFX