Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/der-fruhling/stacker

Save the data to the binary
https://github.com/der-fruhling/stacker

Last synced: about 21 hours ago
JSON representation

Save the data to the binary

Awesome Lists containing this project

README

        

# Stacker
Save the data to the binary

## Usage
Stacker can save multiple different types to the same file.
It uses binary, so its quite compact. Heres how you use it
to stack an `int` value:
```cs
var byteStack = new ByteStack();
byteStack.Add(new StackableInt(5));
var bytes = byteStack.Stack(); // byte[]
var unstacked = ByteStack.Unstack(bytes); // ByteStack
if (unstacked.Stackables[0] is StackableInt stackableInt) {
Console.WriteLine(stackableInt.Value);
}
```