org.ipdr.xdr
Class XDRUnMarshaller

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

public class XDRUnMarshaller
extends java.lang.Object

XDRUnMarshaller is the simplest marshalling mechanism using basic Java InputStream objects. No intermediate buffering is used, this allows appropriate buffering to be determined by the InputStream provider (e.g. the stream could be a BufferedInputStream).


Field Summary
protected static byte FALSE
          Byte containing FALSE value
protected  java.lang.String ipdrVersion_
          String containing IPDR Version
protected  java.io.InputStream sourceStream_
          To store the Source stream.
protected static byte TRUE
          Byte containing TRUE value
 
Constructor Summary
XDRUnMarshaller(java.io.InputStream is)
          Constructor for the XDRUnMarshaller object.
 
Method Summary
 void close()
          Method to close the inpur stream.
 java.lang.String getVersion()
          Method to get the IPDR Version.
static void main(java.lang.String[] args)
          Simple demonstration entry point.
 boolean read_boolean()
          Method to read a 'boolean' from the input stream.
 byte read_byte()
          Method to read a 'byte' from the input stream.
 double read_double()
          Method to read a 'double' from the input stream.
 float read_float()
          Method to read a 'float' from the input stream.
 int read_long()
          Method to read an 'int' from the input stream.
 long read_longlong()
          Method to read a 'long' from the input stream.
 void read_octet_array(byte[] array, int off, int len)
          Method to read a 'octet array' from the input stream.
 short read_short()
          Method to read a 'short' from the input stream.
 long read_u_long()
          Method to read an 'unsigned int' from the input stream.
 java.lang.String read_wstring()
          Method to read a 'string' from the input stream.
 int read()
          Method to read a 'byte' from the input stream.
 void setVersion(java.lang.String ver)
          Method to set the IPDR Version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceStream_

protected java.io.InputStream sourceStream_
To store the Source stream.


TRUE

protected static final byte TRUE
Byte containing TRUE value

See Also:
Constant Field Values

FALSE

protected static final byte FALSE
Byte containing FALSE value

See Also:
Constant Field Values

ipdrVersion_

protected java.lang.String ipdrVersion_
String containing IPDR Version

Constructor Detail

XDRUnMarshaller

public XDRUnMarshaller(java.io.InputStream is)
Constructor for the XDRUnMarshaller object. Sets the input stream.

Parameters:
is - Input Stream
Method Detail

setVersion

public void setVersion(java.lang.String ver)
Method to set the IPDR Version.

Parameters:
ver - IPDR Version.

getVersion

public java.lang.String getVersion()
Method to get the IPDR Version.

Returns:
IPDR Version

read

public int read()
         throws java.io.IOException
Method to read a 'byte' from the input stream.

Returns:
the 'byte' read
Throws:
java.io.IOException - when an exception occurs while reading

close

public void close()
           throws java.io.IOException
Method to close the inpur stream.

Throws:
java.io.IOException - when an exception occurs while closing

read_long

public int read_long()
              throws java.io.IOException
Method to read an 'int' from the input stream.

Returns:
The 'int' read
Throws:
java.io.IOException - when an exception occurs while reading

read_u_long

public long read_u_long()
                 throws java.io.IOException
Method to read an 'unsigned int' from the input stream.

Returns:
The 'unsigned int' read
Throws:
java.io.IOException - when an exception occurs while reading

read_longlong

public long read_longlong()
                   throws java.io.IOException
Method to read a 'long' from the input stream.

Returns:
The 'long' read
Throws:
java.io.IOException - when an exception occurs while reading

read_float

public float read_float()
                 throws java.io.IOException
Method to read a 'float' from the input stream.

Returns:
The 'float' read
Throws:
java.io.IOException - when an exception occurs while reading

read_double

public double read_double()
                   throws java.io.IOException
Method to read a 'double' from the input stream.

Returns:
The 'double' read
Throws:
java.io.IOException - when an exception occurs while reading

read_wstring

public java.lang.String read_wstring()
                              throws java.io.IOException,
                                     IPDRException
Method to read a 'string' from the input stream.

Returns:
The 'string' read
Throws:
java.io.IOException - when an exception occurs while reading
IPDRException - a IPDR functionality related exception occurs

read_octet_array

public void read_octet_array(byte[] array,
                             int off,
                             int len)
                      throws java.io.IOException
Method to read a 'octet array' from the input stream.

Parameters:
array - the buffer into which the data is read
off - the start offset in array at which the data is written
len - the maximum number of bytes to read
Throws:
java.io.IOException - when an exception occurs while reading

read_byte

public byte read_byte()
               throws java.io.IOException
Method to read a 'byte' from the input stream.

Throws:
java.io.IOException

read_boolean

public boolean read_boolean()
                     throws java.io.IOException
Method to read a 'boolean' from the input stream.

Throws:
java.io.IOException

read_short

public short read_short()
                 throws java.io.IOException
Method to read a 'short' from the input stream.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Simple demonstration entry point.