Skip to main content

CacheFileFormat

A class in Root.Township, Alta.Static.

File format for cached data such as instruction sets: a byte count followed by the stream's words.

Constructors​

MemberWhat it is
CacheFileFormat()Creates a CacheFileFormat from data and byteCount.
CacheFileFormat(uint[] data, uint byteCount)Creates a CacheFileFormat from data and byteCount.

Fields​

4 private and internal fields
MemberWhat it is
private uint[] byteCountBacking array for ByteCount (one element, so it can be block copied).
private byte[] compressedDataBacking field for CompressedData.
private uint[] dataBacking field for Data.
private int useCountHow many users hold this file format.

Properties​

MemberWhat it is
uint ByteCount { get; }Number of bytes of real data.
byte[] CompressedData { get; }The data gzipped, made on first use and kept. Nothing else in this build reads it.
uint[] Data { get; }The raw stream data as uints.

Methods​

MemberWhat it is
override IAltaFileFormat Clone()Returns the same object and bumps the use count.
override void Dispose()Lowers the use count; frees nothing.
async Task<T> ReadAsAsync<T>(T into)Reads the version, then deserializes the data into the given ICacheable.
override void ReadFrom(FileInfo info, Stream stream)Loads the byte count and data from a file stream.
void Write(ICacheable input)Serializes an ICacheable with its version in front and keeps the result.
override void WriteTo(Stream stream, CancellationToken token)Writes the byte count and data to a file stream.