Skip to content

implementation of Haxe serialization protocol for java

Notifications You must be signed in to change notification settings

akalanitski/haxe-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov

Haxe has really amazing data serialization/deserialization mechanism. This library provide the most common abilities to use Java with Haxe front-end or backend. This is mostly copy-paste from Haxe Standard Library with corrections to use it without the rest of library.

Haxe Messaging Format

Full definition of Haxe Messaging Format available in the documentation. Threre is full list of types supported for serialization/deserialization with haxe-networking.

Primitive Complex Special Values
int String 0
float Date NaN
boolean Array null
List +Infinity
Map* -Infinity
Objects
Exceptions

How to use

import org.haxe.net.HaxeDeserializer;
import org.haxe.net.HaxeSerializer;

public class Main {

    public static void main(String[] args) throws Exception {
        HaxeSerializer serializer = new HaxeSerializer();
        serializer.serialize("foo");
        serializer.serialize(12);
        String s = serializer.toString();
        System.out.println(s); // y3:fooi12

        HaxeDeserializer deserializer = new HaxeDeserializer(new StringBuffer(s));
        System.out.println(deserializer.deserialize()); // foo
        System.out.println(deserializer.deserialize()); // 12
    }
}

About

implementation of Haxe serialization protocol for java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages