Table of Contents

Class DLCStreamProvider

Namespace
DLCToolkit
Assembly
DLCToolkit.dll

Represents a data stream source containing DLC content.

public abstract class DLCStreamProvider : IDisposable
Inheritance
DLCStreamProvider
Implements

Properties

HintPath

Get the path where the DLC content was sourced from.

public abstract string HintPath { get; }

Property Value

string

SupportsMultipleStreams

Does the stream provider support multiple simultaneous open read streams. Can improve performance if enabled but each opened stream must have a unique stream/file handle to avoid seek read issues.

public abstract bool SupportsMultipleStreams { get; }

Property Value

bool

Methods

Dispose()

Dispose of any open streams used by this stream provider.

public abstract void Dispose()

FromData(byte[], string)

Create a stream provider from the specified dlc file data. This is recommended over FromStream(Stream, string) as it can support multiple simultaneous reads for quicker loading.

public static DLCStreamProvider FromData(byte[] data, string hintPath = null)

Parameters

data byte[]

The data where the dlc content is stored

hintPath string

An optional hint path describing where the stream content originated from

Returns

DLCStreamProvider

A stream provider that allows access to the DLC content via a standard API

FromFile(string)

Create a stream provider from the specified file path. It is highly recommended to use this option where possible, as reading from file path can support multiple simultaneous read operations to offset quicker load times.

public static DLCStreamProvider FromFile(string localDLCPath)

Parameters

localDLCPath string

The file path for the DLC content

Returns

DLCStreamProvider

A stream provider that allows access to the DLC content via a standard API

FromStream(Stream, string)

Create a stream provider from the specified stream. Use FromData(byte[], string) or FromFile(string) where possible as both options support multiple simultaneous read calls for quicker loading.

public static DLCStreamProvider FromStream(Stream stream, string hintPath = null)

Parameters

stream Stream

The stream to load the content from

hintPath string

An optional hint path describing where the stream content originated from

Returns

DLCStreamProvider

A stream provider that allows access to the DLC content via a standard API

OpenReadStream()

Try to open the DLC content stream for reading.

public abstract Stream OpenReadStream()

Returns

Stream

An open readable stream that supports seeking

OpenReadStream(long, long)

Try to open the DLC content stream for reading with the specified stream offset and size bounds. The returned streams position '0' must represent the given offset for example.

public abstract Stream OpenReadStream(long offset, long size)

Parameters

offset long

The offset into the base stream

size long

The size of the data stream

Returns

Stream