diff options
| author | Sgeo <[email protected]> | 2017-06-12 22:27:44 -0400 |
|---|---|---|
| committer | Sgeo <[email protected]> | 2017-06-12 22:27:44 -0400 |
| commit | 01fe53ddb1341440ccca1b93dcb345a156332858 (patch) | |
| tree | 54772984e7ef990a0bab9ea08bdb645f9da272d4 /Persister-(.world-etc.)-format.md | |
| parent | Add link for PROPREQ and improve description (diff) | |
| download | libreworlds-wiki-01fe53ddb1341440ccca1b93dcb345a156332858.tar.xz libreworlds-wiki-01fe53ddb1341440ccca1b93dcb345a156332858.zip | |
Created Persister (.world etc.) format (markdown)
Diffstat (limited to 'Persister-(.world-etc.)-format.md')
| -rw-r--r-- | Persister-(.world-etc.)-format.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Persister-(.world-etc.)-format.md b/Persister-(.world-etc.)-format.md new file mode 100644 index 0000000..dd2389f --- /dev/null +++ b/Persister-(.world-etc.)-format.md @@ -0,0 +1,8 @@ +Data in Persister format does not mark itself to indicate their types, the types are assumed by the deserialization code. That is, a Portal being read in knows when to expect a boolean, a string, and an integer, for example. Without knowing what a Portal wants to read, it is not possible to determine where the next item begins. + +# Primitive data types + +Worlds generally uses the format described by [Java's DataInput](https://docs.oracle.com/javase/7/docs/api/java/io/DataInput.html). + +* String: Starts with a byte, where 0x01 means the string is null (and the next byte is for the next item) and 0x00 means non-null. If non-null, next 2 bytes are the length in number of bytes (big-endian). Following is the actual string data, in modified UTF-8. (The bytes after the non-null indicator are merely read by DataInput). +* Boolean: 1 byte, 0x00 for false 0x01 for true. |