All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class orbasec.corba.CDREncoder

java.lang.Object
   |
   +----org.omg.CORBA.portable.OutputStream
           |
           +----orbasec.corba.CDREncoder

public class CDREncoder
extends OutputStream
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 CDREncoder()
Creates its own internal CDR Buffer, use _A_buffer() to retrieve it.
 o CDREncoder(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.

Method Index

 o _A_buffer()
Returns the CDRBuffer associated with this encoder.
 o create_input_stream()
 o write_any(Any)
Not implemented
 o write_boolean(boolean)
 o write_boolean_array(boolean[], int, int)
 o write_char(char)
 o write_char_array(char[], int, int)
 o write_double(double)
 o write_double_array(double[], int, int)
 o write_float(float)
 o write_float_array(float[], int, int)
 o write_long(int)
 o write_long_array(int[], int, int)
 o write_longlong(long)
 o write_longlong_array(long[], int, int)
 o write_Object(Object)
Not implemented
 o write_octet(byte)
 o write_octet_array(byte[], int, int)
 o write_Principal(Principal)
Not implemented
 o write_short(short)
 o write_short_array(short[], int, int)
 o write_string(String)
 o write_TypeCode(TypeCode)
Not implemented
 o write_ulong(int)
 o write_ulong_array(int[], int, int)
 o write_ulonglong(long)
 o write_ulonglong_array(long[], int, int)
 o write_ushort(short)
 o write_ushort_array(short[], int, int)
 o write_wchar(char)
 o write_wchar_array(char[], int, int)
 o write_wstring(String)

Constructors

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

 o CDREncoder
 public CDREncoder(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.

Methods

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

 o create_input_stream
 public InputStream create_input_stream()
Overrides:
create_input_stream in class OutputStream
 o write_boolean
 public void write_boolean(boolean value)
Overrides:
write_boolean in class OutputStream
 o write_char
 public void write_char(char value)
Overrides:
write_char in class OutputStream
 o write_wchar
 public void write_wchar(char value)
Overrides:
write_wchar in class OutputStream
 o write_octet
 public void write_octet(byte value)
Overrides:
write_octet in class OutputStream
 o write_short
 public void write_short(short value)
Overrides:
write_short in class OutputStream
 o write_ushort
 public void write_ushort(short value)
Overrides:
write_ushort in class OutputStream
 o write_long
 public void write_long(int value)
Overrides:
write_long in class OutputStream
 o write_ulong
 public void write_ulong(int value)
Overrides:
write_ulong in class OutputStream
 o write_longlong
 public void write_longlong(long value)
Overrides:
write_longlong in class OutputStream
 o write_ulonglong
 public void write_ulonglong(long value)
Overrides:
write_ulonglong in class OutputStream
 o write_float
 public void write_float(float value)
Overrides:
write_float in class OutputStream
 o write_double
 public void write_double(double value)
Overrides:
write_double in class OutputStream
 o write_string
 public void write_string(String value)
Overrides:
write_string in class OutputStream
 o write_wstring
 public void write_wstring(String value)
Overrides:
write_wstring in class OutputStream
 o write_boolean_array
 public void write_boolean_array(boolean value[],
                                 int offset,
                                 int length)
Overrides:
write_boolean_array in class OutputStream
 o write_char_array
 public void write_char_array(char value[],
                              int offset,
                              int length)
Overrides:
write_char_array in class OutputStream
 o write_wchar_array
 public void write_wchar_array(char value[],
                               int offset,
                               int length)
Overrides:
write_wchar_array in class OutputStream
 o write_octet_array
 public void write_octet_array(byte value[],
                               int offset,
                               int length)
Overrides:
write_octet_array in class OutputStream
 o write_short_array
 public void write_short_array(short value[],
                               int offset,
                               int length)
Overrides:
write_short_array in class OutputStream
 o write_ushort_array
 public void write_ushort_array(short value[],
                                int offset,
                                int length)
Overrides:
write_ushort_array in class OutputStream
 o write_long_array
 public void write_long_array(int value[],
                              int offset,
                              int length)
Overrides:
write_long_array in class OutputStream
 o write_ulong_array
 public void write_ulong_array(int value[],
                               int offset,
                               int length)
Overrides:
write_ulong_array in class OutputStream
 o write_longlong_array
 public void write_longlong_array(long value[],
                                  int offset,
                                  int length)
Overrides:
write_longlong_array in class OutputStream
 o write_ulonglong_array
 public void write_ulonglong_array(long value[],
                                   int offset,
                                   int length)
Overrides:
write_ulonglong_array in class OutputStream
 o write_float_array
 public void write_float_array(float value[],
                               int offset,
                               int length)
Overrides:
write_float_array in class OutputStream
 o write_double_array
 public void write_double_array(double value[],
                                int offset,
                                int length)
Overrides:
write_double_array in class OutputStream
 o write_Object
 public void write_Object(Object value)
Not implemented

Overrides:
write_Object in class OutputStream
 o write_TypeCode
 public void write_TypeCode(TypeCode value)
Not implemented

Overrides:
write_TypeCode in class OutputStream
 o write_any
 public void write_any(Any value)
Not implemented

Overrides:
write_any in class OutputStream
 o write_Principal
 public void write_Principal(Principal value)
Not implemented

Overrides:
write_Principal in class OutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index