C# Класс TagTool.Cache.ResourceCache

A .dat file containing resource data (e.g. resources.dat).
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( Stream inStream, byte data, uint &compressedSize ) : int

Adds a resource to the cache.

AddRaw ( Stream inStream, byte rawData ) : int

Adds a raw, pre-compressed resource to the cache.

Compress ( Stream inStream, int resourceIndex, byte data ) : uint

Compresses and saves data for a resource.

Decompress ( Stream inStream, int resourceIndex, uint compressedSize, Stream outStream ) : void

Decompresses a resource.

ExtractRaw ( Stream inStream, int resourceIndex, uint compressedSize ) : byte[]

Extracts raw, compressed resource data.

ImportRaw ( Stream inStream, int resourceIndex, byte data ) : void

Overwrites a resource with raw, pre-compressed data.

ResourceCache ( Stream stream ) : System

Loads a resource cache from a stream.

UpdateResourceTable ( BinaryWriter writer ) : void

Приватные методы

Метод Описание
Load ( Stream stream ) : void
NewResource ( ) : int
ResizeResource ( BinaryWriter writer, int resourceIndex, uint minSize ) : uint

Описание методов

Add() публичный Метод

Adds a resource to the cache.
public Add ( Stream inStream, byte data, uint &compressedSize ) : int
inStream Stream The stream open on the resource cache.
data byte The data to compress.
compressedSize uint On return, the size of the compressed data.
Результат int

AddRaw() публичный Метод

Adds a raw, pre-compressed resource to the cache.
public AddRaw ( Stream inStream, byte rawData ) : int
inStream Stream The stream open on the resource cache.
rawData byte The raw data to add.
Результат int

Compress() публичный Метод

Compresses and saves data for a resource.
public Compress ( Stream inStream, int resourceIndex, byte data ) : uint
inStream Stream The stream open on the resource data. It must have read/write access.
resourceIndex int The index of the resource to edit.
data byte The data to compress.
Результат uint

Decompress() публичный Метод

Decompresses a resource.
public Decompress ( Stream inStream, int resourceIndex, uint compressedSize, Stream outStream ) : void
inStream Stream The stream open on the resource cache.
resourceIndex int The index of the resource to decompress.
compressedSize uint Total size of the compressed data, including chunk headers.
outStream Stream The stream to write the decompressed resource data to.
Результат void

ExtractRaw() публичный Метод

Extracts raw, compressed resource data.
public ExtractRaw ( Stream inStream, int resourceIndex, uint compressedSize ) : byte[]
inStream Stream The stream open on the resource cache.
resourceIndex int The index of the resource to decompress.
compressedSize uint Total size of the compressed data, including chunk headers.
Результат byte[]

ImportRaw() публичный Метод

Overwrites a resource with raw, pre-compressed data.
public ImportRaw ( Stream inStream, int resourceIndex, byte data ) : void
inStream Stream The stream open on the resource cache.
resourceIndex int The index of the resource to overwrite.
data byte The raw, pre-compressed data to overwrite it with.
Результат void

ResourceCache() публичный Метод

Loads a resource cache from a stream.
public ResourceCache ( Stream stream ) : System
stream Stream The stream to read from.
Результат System

UpdateResourceTable() публичный Метод

public UpdateResourceTable ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter
Результат void