Package akka.serialization

Examples of akka.serialization.Serializer


    MyMessage originalMessage = new MyMessage("Munish", 36, "Bangalore");

    System.out.println("The original message is as " + originalMessage);

    // Get the Binded Serializer for it
    Serializer serializer = serialization
        .findSerializerFor(originalMessage);

    // Turn the object into bytes
    byte[] bytes = serializer.toBinary(originalMessage);

    // Turn the byte[] back into an object,
    MyMessage deSerializedMessage = (MyMessage) serializer.fromBinary(
        bytes, MyMessage.class);

    System.out.println("The de-serialized message is as " + deSerializedMessage);

    system.shutdown();
View Full Code Here

TOP

Related Classes of akka.serialization.Serializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.