Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/der-fruhling/stacker
- Owner: der-fruhling
- License: mit
- Created: 2020-09-10T22:56:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T23:04:52.000Z (about 4 years ago)
- Last Synced: 2023-11-10T22:28:18.161Z (about 1 year ago)
- Language: C#
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
}
```