All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.higgs.examples.boson.DemoClient Maven / Gradle / Ivy

There is a newer version: 0.0.24
Show newest version
package io.higgs.examples.boson;

import io.higgs.boson.serialization.mutators.ReadMutator;
import io.higgs.boson.serialization.mutators.WriteMutator;
import io.higgs.boson.serialization.v1.BosonReader;
import io.higgs.boson.serialization.v1.BosonWriter;
import io.netty.buffer.ByteBuf;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Courtney Robinson 
 */
public class DemoClient {
    protected DemoClient() {
    }

    public static void main(String... args) {
        Set writeMutators = new HashSet<>();
        Set readMutators = new HashSet<>();

        //
        PoloExample poloExample = new PoloExample();
        Nested nested = new Nested();
        //
        BosonWriter writer = new BosonWriter(readMutators);
        BosonReader reader = new BosonReader(writeMutators);

        ByteBuf serializedPolo = writer.serialize(poloExample);
        PoloExample deserializedPolo = reader.deSerialize(serializedPolo);

        System.out.println(poloExample);
        System.out.println(deserializedPolo);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy