org.alfresco.zookeeper
Class ZkStringSerializer

java.lang.Object
  extended by org.alfresco.zookeeper.ZkStringSerializer
All Implemented Interfaces:
org.I0Itec.zkclient.serialize.ZkSerializer

public class ZkStringSerializer
extends Object
implements org.I0Itec.zkclient.serialize.ZkSerializer

A serializer that is compatible with the ZooKeeper command line client (ZkCli).

TODO: Handle different encodings because the ZkCli does not!

Since:
1.0
Author:
Derek Hulley

Constructor Summary
ZkStringSerializer()
           
 
Method Summary
 Object deserialize(byte[] bytes)
          TODO: Cater for mixed charsets inboud
 byte[] serialize(Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZkStringSerializer

public ZkStringSerializer()
Method Detail

serialize

public byte[] serialize(Object data)
                 throws org.I0Itec.zkclient.exception.ZkMarshallingError
Specified by:
serialize in interface org.I0Itec.zkclient.serialize.ZkSerializer
Parameters:
data - String data
Returns:
the UTF-8 byte representation of the data
Throws:
org.I0Itec.zkclient.exception.ZkMarshallingError

deserialize

public Object deserialize(byte[] bytes)
                   throws org.I0Itec.zkclient.exception.ZkMarshallingError
TODO: Cater for mixed charsets inboud

Specified by:
deserialize in interface org.I0Itec.zkclient.serialize.ZkSerializer
Parameters:
bytes - the UTF-8 byte representation of a String.
Throws:
org.I0Itec.zkclient.exception.ZkMarshallingError


Copyright © 2012. All Rights Reserved.