org.ipdr.xdr
Class CompositeDataHelper

java.lang.Object
  extended by org.ipdr.xdr.CompositeDataHelper

public abstract class CompositeDataHelper
extends java.lang.Object

A java convenience class to go between the OpenMBean style data structure to the compact encoding.

The encoding is determined by the descriptor. It is assumed that the descriptor id given does in fact match the OpenMBean style type description.


Field Summary
static int COMPACT_FORMAT_LENGTH
          Integer representing the 'undefined' length of an XDR.
 
Constructor Summary
CompositeDataHelper()
           
 
Method Summary
static CompositeData read(XDRUnMarshaller istream, CompositeType descriptor)
          Method to read IPDR Docs.
static void write(XDRMarshaller ostream, CompositeData value)
          Method to write IPDR Docs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPACT_FORMAT_LENGTH

public static int COMPACT_FORMAT_LENGTH
Integer representing the 'undefined' length of an XDR.

Constructor Detail

CompositeDataHelper

public CompositeDataHelper()
Method Detail

read

public static CompositeData read(XDRUnMarshaller istream,
                                 CompositeType descriptor)
                          throws java.io.IOException,
                                 BadCompositeException,
                                 IPDRException
Method to read IPDR Docs. Non-standard form of read. In order to unmarshall this correctly descriptor information is required.

Parameters:
istream - Input stream to read from
descriptor - Composite Type that describes the data
Returns:
Composite Data read
Throws:
java.io.IOException - when an exception occurs while reading
BadCompositeException - when an exception occurs creation of the Composite Data object
IPDRException - when a IPDR functionality related exception occurs

write

public static void write(XDRMarshaller ostream,
                         CompositeData value)
                  throws java.io.IOException,
                         IPDRException
Method to write IPDR Docs. Non-standard form of write.

Parameters:
ostream - Output stream to write to
value - Composite Data to write
Throws:
java.io.IOException - when an exception occurs while writing
IPDRException - when a IPDR functionality related exception occurs