Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sewer56/afslib
A simple .NET library for reading and writing CRIWare AFS archives.
https://github.com/sewer56/afslib
afs archive cri criware csharp tool tools
Last synced: 19 days ago
JSON representation
A simple .NET library for reading and writing CRIWare AFS archives.
- Host: GitHub
- URL: https://github.com/sewer56/afslib
- Owner: Sewer56
- License: mit
- Created: 2019-12-29T07:07:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T23:18:11.000Z (12 months ago)
- Last Synced: 2024-10-04T08:19:44.715Z (about 1 month ago)
- Topics: afs, archive, cri, criware, csharp, tool, tools
- Language: C#
- Size: 2.27 MB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# AfsLib
A simple, relatively fast library for the reading and writing of CRIWare AFS archives.
## Usage
### Previewing an AFS File
You can preview an AFS file by creating an instance of `AfsFileViewer`.
In this mode, the AFS file is directly loaded from memory. No copying is done, allowing you to quickly inspect the structure of the AFS archive..```csharp
var data = File.ReadAllBytes(afsFilePath);
if (AfsFileViewer.TryFromFile(data, out var afsViewer))
{
// Do stuff.
};
```### Reading data from a single entry in an AFS File
To get the data from a single entry inside an AFS with minimal memory footprint, use the static method:
```csharp
AfsArchive.SeekToAndLoadDataFromIndex(stream, index)
```This will seek through the file and return a byte[] containing just the data at that index.
This is useful for large AFS with one-off reads.### Editing an AFS File
To edit an AFS file, create an instance of `AfsArchive`.
`AfsArchive` reads all of the data from an `AfsFileViewer`, converting it into a format easier to edit for the end user.```csharp
var data = File.ReadAllBytes(afsFilePath);
if (AfsArchive.TryFromFile(data, out var afsArchive))
{
// Do stuff.
};
```To convert the file back to bytes, use the `ToBytes` method.
```csharp
afsArchive.ToBytes();
```