Table of Contents

Class ByteArrayChunk

Namespace
MongoDB.Bson.IO
Assembly
MongoDB.Bson.dll

Represents a chunk backed by a byte array.

public class ByteArrayChunk : IBsonChunk, IDisposable
Inheritance
ByteArrayChunk
Implements
Inherited Members
Extension Methods

Constructors

ByteArrayChunk(byte[])

Initializes a new instance of the ByteArrayChunk class.

public ByteArrayChunk(byte[] bytes)

Parameters

bytes byte[]

The bytes.

Exceptions

ArgumentNullException

bytes

ByteArrayChunk(int)

Initializes a new instance of the ByteArrayChunk class.

public ByteArrayChunk(int size)

Parameters

size int

The size.

Properties

Bytes

Gets the bytes.

public ArraySegment<byte> Bytes { get; }

Property Value

ArraySegment<byte>

The bytes.

Methods

Dispose()

public void Dispose()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Fork()

Returns a new reference to the same chunk that can be independently disposed.

public IBsonChunk Fork()

Returns

IBsonChunk

A new reference to the same chunk.