org.openorb.iiop
Class CDRInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.omg.CORBA.portable.InputStream
          extended byorg.omg.CORBA_2_3.portable.InputStream
              extended byorg.openorb.io.AbstractInputStream
                  extended byorg.openorb.iiop.CDRInputStream
All Implemented Interfaces:
ExtendedInputStream

public class CDRInputStream
extends AbstractInputStream

This class implements CDR for IIOP

Version:
$Revision: 1.5 $ $Date: 2001/08/13 03:47:33 $
Author:
Chris Wood <wood@intalio.com>

Constructor Summary
CDRInputStream(ORB orb, boolean bigEndian, Version version, BufferSource source)
          Constructor used by lower layer.
CDRInputStream(ORB orb, boolean bigEndian, Version version, StorageBuffer buf)
          Constructor used by codec.
 
Method Summary
 void alignment(int size)
          Adjust alignment.
 void begin_encapsulation()
          Encapsulation begin.
 boolean bigEndian()
          Get the endian mode
 void bigEndian(boolean bigEndian)
          Set the endian mode
 void end_encapsulation()
          skip to end of current encapsulation
 int index()
          Get the current index in the buffer.
 void mark(int readlimit)
           
 ORB orb()
          Get the orb associated with the stream.
 java.lang.Object read_abstract_interface()
          Read an abstract interface
 java.lang.Object read_abstract_interface(java.lang.Class clz)
          Read an abstract interface
 Any read_any()
          Read an any
 void read_boolean_array(boolean[] val, int off, int len)
          Read an IDL boolean array
 boolean read_boolean()
          Return an IDL boolean
 void read_char_array(char[] val, int voff, int len)
          Read an IDL char array from the stream
 char read_char()
          Return an IDL char
 Context read_Context()
          Read a context
 void read_double_array(double[] val, int off, int len)
          Read a double array
 double read_double()
          Return an IDL double
 java.math.BigDecimal read_fixed()
          Deprecated. Loses scale and precision, see http://www.omg.org/issues/issue3431.txt
 java.math.BigDecimal read_fixed(short digits, short scale)
          read a fixed.
 java.math.BigDecimal read_fixed(TypeCode type)
          read a fixed.
 void read_float_array(float[] val, int off, int len)
          Read a float array
 float read_float()
          Return an IDL float
 void read_long_array(int[] val, int off, int len)
          Read a long array
 int read_long()
          Return an IDL long
 void read_longlong_array(long[] val, int off, int len)
          Read a long long array
 long read_longlong()
          Return an IDL long long
 Object read_Object()
          Read an object
 Object read_Object(java.lang.Class clz)
          Read an Object
 void read_octet_array(byte[] val, int off, int len)
          Read an octet array
 byte read_octet()
          Return an IDL octet
 Principal read_Principal()
          Read a principal
 void read_short_array(short[] val, int off, int len)
          Read a short array
 short read_short()
          Return an IDL short
 java.lang.String read_string()
          Return an IDL string
 TypeCode read_TypeCode()
          Read a typecode
 void read_ulong_array(int[] val, int off, int len)
          Read an unsigned long array
 int read_ulong()
          Return an IDL unsigned long
 void read_ulonglong_array(long[] val, int off, int len)
          Read an unsigned long long array
 long read_ulonglong()
          Return an IDL unsigned long long
 void read_ushort_array(short[] val, int off, int len)
          Read an unsigned short array
 short read_ushort()
          Return an IDL unsigned short
 java.io.Serializable read_value()
          Read a value from a CDR stream
 java.io.Serializable read_value(BoxedValueHelper boxhelp)
          Read a value from a CDR stream
 java.io.Serializable read_value(java.lang.Class clz)
          Read a value from a CDR stream
 java.io.Serializable read_value(java.io.Serializable value)
          Read value state from the stream.
 java.io.Serializable read_value(java.lang.String rep_id)
          Read a value from a CDR stream
 void read_wchar_array(char[] val, int voff, int vlen)
          Read a wchar array
 char read_wchar()
          Return an IDL wchar
 java.lang.String read_wstring()
          Return an IDL wstring
 void reset_index()
          Reset the index to 0.
 void reset()
           
 void setCodesets(int tcsc, int tcsw)
          Set the translation codesets.
 long skip(long count)
          Skip over bytes.
 Version version()
          Get the CDR protocol version
 
Methods inherited from class org.openorb.io.AbstractInputStream
available, get_codebase, markSupported, read, read, read
 
Methods inherited from class java.io.InputStream
close
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDRInputStream

public CDRInputStream(ORB orb,
                      boolean bigEndian,
                      Version version,
                      StorageBuffer buf)
Constructor used by codec. Extending classes must implement a constructor with this exact signature.


CDRInputStream

public CDRInputStream(ORB orb,
                      boolean bigEndian,
                      Version version,
                      BufferSource source)
Constructor used by lower layer. Extending classes must implement a constructor with this exact signature.

Method Detail

orb

public ORB orb()
Get the orb associated with the stream.

Specified by:
orb in interface ExtendedInputStream
Overrides:
orb in class InputStream

setCodesets

public void setCodesets(int tcsc,
                        int tcsw)
Set the translation codesets.


index

public int index()
Get the current index in the buffer.


reset_index

public void reset_index()
Reset the index to 0. This affects the alignment. Using this inside an encapsulation may cause unexpected behaviour.


version

public Version version()
Get the CDR protocol version


bigEndian

public boolean bigEndian()
Get the endian mode


bigEndian

public void bigEndian(boolean bigEndian)
Set the endian mode


alignment

public void alignment(int size)
Adjust alignment.


begin_encapsulation

public void begin_encapsulation()
Encapsulation begin.


end_encapsulation

public void end_encapsulation()
skip to end of current encapsulation


skip

public long skip(long count)
Skip over bytes.

Overrides:
skip in class AbstractInputStream

mark

public void mark(int readlimit)
Overrides:
mark in class AbstractInputStream

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class AbstractInputStream
Throws:
java.io.IOException

read_boolean

public boolean read_boolean()
Return an IDL boolean

Specified by:
read_boolean in class InputStream

read_char

public char read_char()
Return an IDL char

Specified by:
read_char in class InputStream

read_wchar

public char read_wchar()
Return an IDL wchar

Specified by:
read_wchar in class InputStream

read_octet

public byte read_octet()
Return an IDL octet

Specified by:
read_octet in class InputStream

read_short

public short read_short()
Return an IDL short

Specified by:
read_short in class InputStream

read_ushort

public short read_ushort()
Return an IDL unsigned short

Specified by:
read_ushort in class InputStream

read_long

public int read_long()
Return an IDL long

Specified by:
read_long in class InputStream

read_ulong

public int read_ulong()
Return an IDL unsigned long

Specified by:
read_ulong in class InputStream

read_longlong

public long read_longlong()
Return an IDL long long

Specified by:
read_longlong in class InputStream

read_ulonglong

public long read_ulonglong()
Return an IDL unsigned long long

Specified by:
read_ulonglong in class InputStream

read_float

public float read_float()
Return an IDL float

Specified by:
read_float in class InputStream

read_double

public double read_double()
Return an IDL double

Specified by:
read_double in class InputStream

read_string

public java.lang.String read_string()
Return an IDL string

Specified by:
read_string in class InputStream

read_wstring

public java.lang.String read_wstring()
Return an IDL wstring

Specified by:
read_wstring in class InputStream

read_boolean_array

public void read_boolean_array(boolean[] val,
                               int off,
                               int len)
Read an IDL boolean array

Specified by:
read_boolean_array in class InputStream

read_char_array

public void read_char_array(char[] val,
                            int voff,
                            int len)
Read an IDL char array from the stream

Specified by:
read_char_array in class InputStream

read_wchar_array

public void read_wchar_array(char[] val,
                             int voff,
                             int vlen)
Read a wchar array

Specified by:
read_wchar_array in class InputStream

read_octet_array

public void read_octet_array(byte[] val,
                             int off,
                             int len)
Read an octet array

Specified by:
read_octet_array in class InputStream

read_short_array

public void read_short_array(short[] val,
                             int off,
                             int len)
Read a short array

Specified by:
read_short_array in class InputStream

read_ushort_array

public void read_ushort_array(short[] val,
                              int off,
                              int len)
Read an unsigned short array

Specified by:
read_ushort_array in class InputStream

read_long_array

public void read_long_array(int[] val,
                            int off,
                            int len)
Read a long array

Specified by:
read_long_array in class InputStream

read_ulong_array

public void read_ulong_array(int[] val,
                             int off,
                             int len)
Read an unsigned long array

Specified by:
read_ulong_array in class InputStream

read_longlong_array

public void read_longlong_array(long[] val,
                                int off,
                                int len)
Read a long long array

Specified by:
read_longlong_array in class InputStream

read_ulonglong_array

public void read_ulonglong_array(long[] val,
                                 int off,
                                 int len)
Read an unsigned long long array

Specified by:
read_ulonglong_array in class InputStream

read_float_array

public void read_float_array(float[] val,
                             int off,
                             int len)
Read a float array

Specified by:
read_float_array in class InputStream

read_double_array

public void read_double_array(double[] val,
                              int off,
                              int len)
Read a double array

Specified by:
read_double_array in class InputStream

read_TypeCode

public TypeCode read_TypeCode()
Read a typecode

Specified by:
read_TypeCode in class InputStream

read_any

public Any read_any()
Read an any

Specified by:
read_any in class InputStream

read_Principal

public Principal read_Principal()
Read a principal

Overrides:
read_Principal in class InputStream

read_Object

public Object read_Object()
Read an object

Specified by:
read_Object in class InputStream

read_Object

public Object read_Object(java.lang.Class clz)
Read an Object

Overrides:
read_Object in class InputStream

read_Context

public Context read_Context()
Read a context

Overrides:
read_Context in class InputStream

read_fixed

public java.math.BigDecimal read_fixed()
Deprecated. Loses scale and precision, see http://www.omg.org/issues/issue3431.txt

Read a fixed

Overrides:
read_fixed in class InputStream

read_fixed

public java.math.BigDecimal read_fixed(TypeCode type)
read a fixed.


read_fixed

public java.math.BigDecimal read_fixed(short digits,
                                       short scale)
read a fixed.


read_value

public java.io.Serializable read_value()
Read a value from a CDR stream

Overrides:
read_value in class InputStream

read_value

public java.io.Serializable read_value(java.lang.String rep_id)
Read a value from a CDR stream

Overrides:
read_value in class InputStream

read_value

public java.io.Serializable read_value(java.lang.Class clz)
Read a value from a CDR stream

Overrides:
read_value in class InputStream

read_value

public java.io.Serializable read_value(BoxedValueHelper boxhelp)
Read a value from a CDR stream

Overrides:
read_value in class InputStream

read_value

public java.io.Serializable read_value(java.io.Serializable value)
Read value state from the stream. Called externally by factories with uninitialized value. One of the other read_value functions always appears above it in the call stack.

Overrides:
read_value in class InputStream

read_abstract_interface

public java.lang.Object read_abstract_interface()
Read an abstract interface

Overrides:
read_abstract_interface in class InputStream
Returns:
the readed object ( An CORBA.Object or a value type )

read_abstract_interface

public java.lang.Object read_abstract_interface(java.lang.Class clz)
Read an abstract interface

Overrides:
read_abstract_interface in class InputStream
Parameters:
clz - the stub class for an object
Returns:
the readed object ( An CORBA.Object or a value type )