IOStoreContainer

Namespace: UAssetAPI.IO

Represents an IO store container (utoc/ucas).

public class IOStoreContainer : System.IDisposable

Inheritance ObjectIOStoreContainer
Implements IDisposable

Fields

FilePathTOC

The path of the .utoc file on disk.

public string FilePathTOC;

HasReadToc

public bool HasReadToc;

TocVersion

public EIoStoreTocVersion TocVersion;

ChunkIds

public FIoChunkId[] ChunkIds;

ChunkMap

public Dictionary<FIoChunkId, FIoOffsetAndLength> ChunkMap;

CompressionMethods

public List<EIoCompressionMethod> CompressionMethods;

CompressionBlocks

public List<FIoStoreTocCompressedBlockEntry> CompressionBlocks;

Files

public Dictionary<string, FIoChunkId> Files;

_reserved0

public byte _reserved0;

_reserved1

public ushort _reserved1;

CompressionBlockSize

public uint CompressionBlockSize;

PartitionCount

public uint PartitionCount;

ContainerId

public ulong ContainerId;

EncryptionKeyGuid

public Guid EncryptionKeyGuid;

ContainerFlags

public EIoContainerFlags ContainerFlags;

_reserved3

public byte _reserved3;

_reserved4

public ushort _reserved4;

PartitionSize

public ulong PartitionSize;

_reserved7

public uint _reserved7;

_reserved8

public UInt64[] _reserved8;

TocSignature

public Byte[] TocSignature;

BlockSignature

public Byte[] BlockSignature;

ChunkHashes

public List<Byte[]> ChunkHashes;

MountPoint

public FString MountPoint;

DirectoryEntries

public List<FIoDirectoryEntry> DirectoryEntries;

FileEntries

public List<FIoFileEntry> FileEntries;

MetaData

public List<FIoStoreMetaData> MetaData;

TOC_MAGIC

public static Byte[] TOC_MAGIC;

Constructors

IOStoreContainer(String)

Reads an io store container from disk and initializes a new instance of the IOStoreContainer class to store its data in memory.

public IOStoreContainer(string tocPath)

Parameters

tocPath String
The path of the .utoc file on disk that this instance will read from. Respective .ucas files must be located in the same directory.

Exceptions

FormatException
Throw when the asset cannot be parsed correctly.

IOStoreContainer()

Initializes a new instance of the IOStoreContainer class. This instance will store no container data and does not represent any container in particular until the IOStoreContainer.ReadToc(IOStoreBinaryReader) method is manually called.

public IOStoreContainer()

Methods

ClearNameIndexList()

internal void ClearNameIndexList()

FixNameMapLookupIfNeeded()

internal void FixNameMapLookupIfNeeded()

ContainsNameReference(FString)

internal bool ContainsNameReference(FString search)

Parameters

search FString

Returns

Boolean

SearchNameReference(FString)

internal int SearchNameReference(FString search)

Parameters

search FString

Returns

Int32

AddNameReference(FString, Boolean)

internal int AddNameReference(FString name, bool forceAddDuplicates)

Parameters

name FString

forceAddDuplicates Boolean

Returns

Int32

BeginRead()

Opens a file stream for each partition in this container. This must be called before reading any CAS blocks.

public void BeginRead()

EndRead()

Closes all partition file streams. This must be called once reading CAS blocks has been finished.

public void EndRead()

Dispose()

public void Dispose()

GetAllFiles()

Returns a list of the path of every in this container.

public String[] GetAllFiles()

Returns

String[]
A list of the path of every in this container.

Extract(String)

Extracts every file in this container to disk. This operation may take a while.

public int Extract(string outPath)

Parameters

outPath String
The directory to extract to.

Returns

Int32
The number of files that were successfully extracted.

ReadFile(String)

Reads out a specific file within this container.

public Byte[] ReadFile(string path)

Parameters

path String
The path to the file in question.

Returns

Byte[]
The raw data of the file.

DoesChunkExist(FIoChunkId)

public bool DoesChunkExist(FIoChunkId chunkId)

Parameters

chunkId FIoChunkId

Returns

Boolean

ReadChunk(FIoChunkId)

Reads out a specific chunk.

public Byte[] ReadChunk(FIoChunkId chunkId)

Parameters

chunkId FIoChunkId
The ID of the chunk to read.

Returns

Byte[]
The raw data of the chunk in question.

ReadRaw(Int64, Int64)

Reads out any segment of CAS data.

public Byte[] ReadRaw(long offset, long length)

Parameters

offset Int64
The offset of the chunk to read.

length Int64
The length of the chunk to read.

Returns

Byte[]
The raw data that was read.

ReadToc(IOStoreBinaryReader)

public void ReadToc(IOStoreBinaryReader reader)

Parameters

reader IOStoreBinaryReader

PathToStream(String)

Creates a MemoryStream from an asset path.

public MemoryStream PathToStream(string p)

Parameters

p String
The path to the input file.

Returns

MemoryStream
A new MemoryStream that stores the binary data of the input file.

PathToReader(String)

Creates a BinaryReader from an asset path.

public IOStoreBinaryReader PathToReader(string p)

Parameters

p String
The path to the input file.

Returns

IOStoreBinaryReader
A new BinaryReader that stores the binary data of the input file.