All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class orbasec.corba.CDRDecoder

java.lang.Object
   |
   +----org.omg.CORBA.portable.InputStream
           |
           +----orbasec.corba.CDRDecoder

public class CDRDecoder
extends InputStream
Lightweight CDR Buffer Encoder Decoder

This is a simple class used for decoding and encoding SECIOP and GIOP messages, without any's and type codes.

This object is used in conjunction with CDRBuffer and CDREncoder. This object handles the endian and conversion to byte arrays. The CDRDecoder and CDREncoder implement the CROBA portable InputStream and InputStream respectively.

Example:

   // Create a Kerberos security component.
   org.omg.SECIOP.KerberosV5 krbcomp = .....;
   // Get a big endian buffer and encoder 
   CDRBuffer  buf = new CDRBuffer();
   CDREncoder enc = new CDREncoder(buf);
   buf.writeEndian(); // writes front enidan boolean for Big endian.
   // Write the security component into the buffer.
   org.omg.SECIOP.KerberosV5Helper.write(enc,krbcomp);
   // Convert the buffer to a byte array.
   byte[] component_data = buf.toByteArray();
 

For decoding:

  // Get Kerberos Security Component Data
  byte[] component_data = ...........;
  // Get a buffer and decoder
  CDRBuffer  buf = new CDRBuffer(component_data,0,component_data.length);
  CDRDecoder dec = new CDRDecoder(buf);
  buf.readEndian(); // Reads the endian boolean at the front. Set's up
                    // for big or little endian based on it.
  // Read the security comonent.
  org.omg.SECIOP.KerberosV5 krb5 =
                 org.omg.SECIOP.KerberosV5Helper.read(dec);
 


Constructor Index

 o CDRDecoder()
Creates its own internal CDR Buffer, use _A_buffer() to retrieve it.
 o CDRDecoder(CDRBuffer)
This constructor is the most commonly used since the buffer is the one that writes the endian desigation and converts the data to a byte array.
 o CDRDecoder(CDREncoder)
Used to immediately decode things encoded by an Encoder.

Method Index

 o _A_buffer()
Returns the CDRBuffer associated with this decoder.
 o read_any()
Not implemented
 o read_boolean()
 o read_boolean_array(boolean[], int, int)
 o read_char()
 o read_char_array(char[], int, int)
 o read_double()
 o read_double_array(double[], int, int)
 o read_float()
 o read_float_array(float[], int, int)
 o read_long()
 o read_long_array(int[], int, int)
 o read_longlong()
 o read_longlong_array(long[], int, int)
 o read_Object()
Not implemented
 o read_octet()
 o read_octet_array(byte[], int, int)
 o read_Principal()
Not implemented
 o read_short()
 o read_short_array(short[], int, int)
 o read_string()
 o read_TypeCode()
Not implemented
 o read_ulong()
 o read_ulong_array(int[], int, int)
 o read_ulonglong()
 o read_ulonglong_array(long[], int, int)
 o read_ushort()
 o read_ushort_array(short[], int, int)
 o read_wchar()
 o read_wchar_array(char[], int, int)
 o read_wstring()

Constructors

 o CDRDecoder
 public CDRDecoder(CDRBuffer buf)
This constructor is the most commonly used since the buffer is the one that writes the endian desigation and converts the data to a byte array.

 o CDRDecoder
 public CDRDecoder(CDREncoder enc)
Used to immediately decode things encoded by an Encoder.

 o CDRDecoder
 public CDRDecoder()
Creates its own internal CDR Buffer, use _A_buffer() to retrieve it.

Methods

 o _A_buffer
 public CDRBuffer _A_buffer()
Returns the CDRBuffer associated with this decoder.

 o read_boolean
 public boolean read_boolean()
Overrides:
read_boolean in class InputStream
 o read_char
 public char read_char()
Overrides:
read_char in class InputStream
 o read_wchar
 public char read_wchar()
Overrides:
read_wchar in class InputStream
 o read_octet
 public byte read_octet()
Overrides:
read_octet in class InputStream
 o read_short
 public short read_short()
Overrides:
read_short in class InputStream
 o read_ushort
 public short read_ushort()
Overrides:
read_ushort in class InputStream
 o read_long
 public int read_long()
Overrides:
read_long in class InputStream
 o read_ulong
 public int read_ulong()
Overrides:
read_ulong in class InputStream
 o read_longlong
 public long read_longlong()
Overrides:
read_longlong in class InputStream
 o read_ulonglong
 public long read_ulonglong()
Overrides:
read_ulonglong in class InputStream
 o read_float
 public float read_float()
Overrides:
read_float in class InputStream
 o read_double
 public double read_double()
Overrides:
read_double in class InputStream
 o read_string
 public String read_string()
Overrides:
read_string in class InputStream
 o read_wstring
 public String read_wstring()
Overrides:
read_wstring in class InputStream
 o read_boolean_array
 public void read_boolean_array(boolean value[],
                                int offset,
                                int length)
Overrides:
read_boolean_array in class InputStream
 o read_char_array
 public void read_char_array(char value[],
                             int offset,
                             int length)
Overrides:
read_char_array in class InputStream
 o read_wchar_array
 public void read_wchar_array(char value[],
                              int offset,
                              int length)
Overrides:
read_wchar_array in class InputStream
 o read_octet_array
 public void read_octet_array(byte value[],
                              int offset,
                              int length)
Overrides:
read_octet_array in class InputStream
 o read_short_array
 public void read_short_array(short value[],
                              int offset,
                              int length)
Overrides:
read_short_array in class InputStream
 o read_ushort_array
 public void read_ushort_array(short value[],
                               int offset,
                               int length)
Overrides:
read_ushort_array in class InputStream
 o read_long_array
 public void read_long_array(int value[],
                             int offset,
                             int length)
Overrides:
read_long_array in class InputStream
 o read_ulong_array
 public void read_ulong_array(int value[],
                              int offset,
                              int length)
Overrides:
read_ulong_array in class InputStream
 o read_longlong_array
 public void read_longlong_array(long value[],
                                 int offset,
                                 int length)
Overrides:
read_longlong_array in class InputStream
 o read_ulonglong_array
 public void read_ulonglong_array(long value[],
                                  int offset,
                                  int length)
Overrides:
read_ulonglong_array in class InputStream
 o read_float_array
 public void read_float_array(float value[],
                              int offset,
                              int length)
Overrides:
read_float_array in class InputStream
 o read_double_array
 public void read_double_array(double value[],
                               int offset,
                               int length)
Overrides:
read_double_array in class InputStream
 o read_Object
 public Object read_Object()
Not implemented

Overrides:
read_Object in class InputStream
 o read_TypeCode
 public TypeCode read_TypeCode()
Not implemented

Overrides:
read_TypeCode in class InputStream
 o read_any
 public Any read_any()
Not implemented

Overrides:
read_any in class InputStream
 o read_Principal
 public Principal read_Principal()
Not implemented

Overrides:
read_Principal in class InputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index