Skip to content
A library for storing and reading data in a concise binary format
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
BinSave
LICENSE
README.md

README.md

BinSave

A library for storing and reading data in a concise binary format

Code Example

Import necessary classes

import java.io.File;

import com.preston159.binsave.Save;
import com.preston159.binsave.Data;
import com.preston159.binsave.DataType;

Create a save object

Save s = new Save(new File("file.bin"), new Data("hp", DataType.UINT_8BIT, 1));

Instantiating a Save object automatically loads the data from the file, or creates the file if it does not exist.

Store data

s.storeUint("hp", 255);

Retrieve data

int hp = s.getUint("hp");

Sava data to file

s.store();

It is recommended to not reference the Save object constantly while the program is running. Instead, use the API to load the data into your own data structure on launch, and save the data using the Save object when necessary (e.g. on program close).

Future plans

  • Add save file versions to allow format changes. Currently, any expansion must be done by adding new data to the end of the file.

Release

Latest

0.0.3

0.0.2

0.0.1 NOTE: INTS AND UINTS ARE BROKEN IN THIS VERSION

API Reference

Latest

0.0.3

0.0.2

0.0.1

License

MIT © Preston Petrie

You can’t perform that action at this time.