Skip to content

jingege/yaserde

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yaserde

A very simple serialization/deserialization framework

yaserde = Yet Another SERialization DEserialization framework

  • Easy to use
  • Based on ByteBuffer
  • Serialize raw types

####Serialize raw types

int aint = 3;

Inflat inflat = new Inflat();
inflat.pushInt(aint);

byte[] bytes = inflat.getBytes();

//~here the bytes may be transferred by I/O

Deflat deflat = new Deflat();
deflat.deflat(bytes);

int result = deflat.popInt();

####Serialize a map

MapYaserder<StringYaserder,IntegerYaserder> mapYaserder = new MapYaserder<StringYaserder,IntegerYaserder>();

mapYaserder.put(new StringYaserder("abc"),new IntegerYaserder(2));
mapYaserder.put(new StringYaserder("def"),new IntegerYaserder(3));

Inflat inflat = new Inflat();
inflat.pushYaserder(mapYaserder);

byte[] bytes = inflat.getBytes();

//~here the bytes may be transferred by I/O

MapYaserder<StringYaserder,IntegerYaserder> map = new MapYaserder<StringYaserder, IntegerYaserder>();
Deflat deflat = new Deflat(bytes);
deflat.popYaserder(map);

IntegerYaserder v1 = map.get(new StringYaserder("abc"));

###TODO

  • More Yaserder
  • Usability

About

A very simple serialization/deserialization framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages