cern.cmw
Class DataCodec

java.lang.Object
  extended by cern.cmw.DataCodec

public class DataCodec
extends Object

This utility class allows to convert Data objects to byte arrays and reconstruct them from the binary representation. This is similar to the Java object serialization (which can also be applied to the Java Data objects), but the DataCodec uses a language independent format (Common Data Representation, or CDR) to serialize objects. The CDR encoded Data objects can be stored in a file or a database, and can be passed between C++ and Java applications.

See Also:
"C++ version of this class"

Method Summary
static Data decode(byte[] bar)
          Constructs a Data object from its binary representation in bar.
static byte[] encode(Data data)
          Returns a binary representation of the specified Data object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static byte[] encode(Data data)
Returns a binary representation of the specified Data object.


decode

public static Data decode(byte[] bar)
Constructs a Data object from its binary representation in bar. Returns null if the conversion fails (contents of bar cannot be interpreted as a binary representation of a Data object).



Copyright © 2007 CERN. All Rights Reserved.