C# Class TagTool.Cache.ResourceCache

A .dat file containing resource data (e.g. resources.dat).
Afficher le fichier Open project: TheGuardians/TagTool Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
Load ( Stream stream ) : void
NewResource ( ) : int
ResizeResource ( BinaryWriter writer, int resourceIndex, uint minSize ) : uint

Method Details

Add() public méthode

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.
Résultat int

AddRaw() public méthode

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.
Résultat int

Compress() public méthode

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.
Résultat uint

Decompress() public méthode

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.
Résultat void

ExtractRaw() public méthode

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.
Résultat byte[]

ImportRaw() public méthode

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.
Résultat void

ResourceCache() public méthode

Loads a resource cache from a stream.
public ResourceCache ( Stream stream ) : System
stream Stream The stream to read from.
Résultat System

UpdateResourceTable() public méthode

public UpdateResourceTable ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter
Résultat void