org.openorb.orb.io
Class ListOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.omg.CORBA.portable.OutputStream
          extended byorg.omg.CORBA_2_3.portable.OutputStream
              extended byorg.openorb.orb.io.ListOutputStream
All Implemented Interfaces:
ExtendedOutputStream

public class ListOutputStream
extends org.omg.CORBA_2_3.portable.OutputStream
implements ExtendedOutputStream

This implementation of org.omg.CORBA_2_3.portable.InputStream uses a list as it's backing store. All non primitive types are stored by reference.

The format of the stored types is a TCKind giving the type of the stored value, followed by the stored value itself within an Object wrapper.

Arrays of primitive types are stored as a TCKind.tk_array, followed by an ArrayBlock object containing the stored data. The array data is stored by reference.

The format of all other types is noted.

Version:
$Revision: 1.8 $ $Date: 2004/02/10 21:02:50 $
Author:
Chris Wood

Constructor Summary
ListOutputStream(org.omg.CORBA.ORB orb)
          Create new output stream.
ListOutputStream(org.omg.CORBA.ORB orb, java.util.List contents)
          Create new output stream with destination list.
 
Method Summary
 org.omg.CORBA.portable.InputStream create_input_stream()
          Create a new input stream from the data inserted into this stream.
 boolean equals(java.lang.Object obj)
          Comparisons to ListInputStreams and ListOutputStreams are possible.
 org.omg.CORBA.ORB orb()
          Get the orb associated with the stream.
 void write_abstract_interface(java.lang.Object object)
          Abstract interfaces are written as a TCKind.tk_abstract_interface kind, followed by a TCKind.tk_objref and the reference for objects or a TCKind.tk_value and the value for valuetypes.
 void write_any(org.omg.CORBA.Any value)
          To copy the any's contents to the stream write it's typecode followed with a call to any.write_value.
 void write_boolean_array(boolean[] val, int off, int len)
           
 void write_boolean(boolean i)
           
 void write_char_array(char[] val, int off, int len)
           
 void write_char(char i)
           
 void write_Context(org.omg.CORBA.Context ctx, org.omg.CORBA.ContextList contexts)
          Contexts are written like an array of strings, with name and value pairs for each context.
 void write_double_array(double[] val, int off, int len)
           
 void write_double(double i)
           
 void write_fixed(java.math.BigDecimal value)
           
 void write_fixed(java.math.BigDecimal val, short digits, short scale)
          Fixes problems in old write_fixed.
 void write_fixed(java.math.BigDecimal val, org.omg.CORBA.TypeCode tc)
          Fixes problems in old write_fixed.
 void write_float_array(float[] val, int off, int len)
           
 void write_float(float i)
           
 void write_long_array(int[] val, int off, int len)
           
 void write_long(int i)
           
 void write_longlong_array(long[] val, int off, int len)
           
 void write_longlong(long i)
           
 void write_Object(org.omg.CORBA.Object value)
           
 void write_octet_array(byte[] val, int off, int len)
           
 void write_octet(byte i)
           
 void write_Principal(org.omg.CORBA.Principal value)
          Deprecated. Deprecated by CORBA 2.2
 void write_short_array(short[] val, int off, int len)
           
 void write_short(short i)
           
 void write_string(java.lang.String i)
           
 void write_TypeCode(org.omg.CORBA.TypeCode value)
           
 void write_ulong_array(int[] val, int off, int len)
           
 void write_ulong(int i)
           
 void write_ulonglong_array(long[] val, int off, int len)
           
 void write_ulonglong(long i)
           
 void write_ushort_array(short[] val, int off, int len)
           
 void write_ushort(short i)
           
 void write_value(java.io.Serializable value)
          Valuetypes are stored as a TCKind.tk_value kind followed by a reference to the value.
 void write_value(java.io.Serializable value, org.omg.CORBA.portable.BoxedValueHelper boxhelp)
          Boxed valuetypes are stored as a TCKind.tk_value_box, followed by the box helper, followed by the contents of the valuebox as written by the helper.
 void write_value(java.io.Serializable value, java.lang.Class clz)
           
 void write_value(java.io.Serializable value, java.lang.String repositoryId)
          Valuetypes are stored as a TCKind.tk_value kind followed by a reference to the value.
 void write_wchar_array(char[] val, int off, int len)
           
 void write_wchar(char i)
           
 void write_wstring(java.lang.String i)
           
 
Methods inherited from class org.omg.CORBA.portable.OutputStream
write
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListOutputStream

public ListOutputStream(org.omg.CORBA.ORB orb)
Create new output stream.


ListOutputStream

public ListOutputStream(org.omg.CORBA.ORB orb,
                        java.util.List contents)
Create new output stream with destination list.

Method Detail

orb

public org.omg.CORBA.ORB orb()
Get the orb associated with the stream.

Specified by:
orb in interface ExtendedOutputStream

create_input_stream

public org.omg.CORBA.portable.InputStream create_input_stream()
Create a new input stream from the data inserted into this stream. Both streams will share the list data.


write_boolean

public void write_boolean(boolean i)

write_boolean_array

public void write_boolean_array(boolean[] val,
                                int off,
                                int len)

write_octet

public void write_octet(byte i)

write_octet_array

public void write_octet_array(byte[] val,
                              int off,
                              int len)

write_short

public void write_short(short i)

write_short_array

public void write_short_array(short[] val,
                              int off,
                              int len)

write_ushort

public void write_ushort(short i)

write_ushort_array

public void write_ushort_array(short[] val,
                               int off,
                               int len)

write_long

public void write_long(int i)

write_long_array

public void write_long_array(int[] val,
                             int off,
                             int len)

write_ulong

public void write_ulong(int i)

write_ulong_array

public void write_ulong_array(int[] val,
                              int off,
                              int len)

write_longlong

public void write_longlong(long i)

write_longlong_array

public void write_longlong_array(long[] val,
                                 int off,
                                 int len)

write_ulonglong

public void write_ulonglong(long i)

write_ulonglong_array

public void write_ulonglong_array(long[] val,
                                  int off,
                                  int len)

write_float

public void write_float(float i)

write_float_array

public void write_float_array(float[] val,
                              int off,
                              int len)

write_double

public void write_double(double i)

write_double_array

public void write_double_array(double[] val,
                               int off,
                               int len)

write_char

public void write_char(char i)

write_char_array

public void write_char_array(char[] val,
                             int off,
                             int len)

write_wchar

public void write_wchar(char i)

write_wchar_array

public void write_wchar_array(char[] val,
                              int off,
                              int len)

write_string

public void write_string(java.lang.String i)

write_wstring

public void write_wstring(java.lang.String i)

write_Object

public void write_Object(org.omg.CORBA.Object value)

write_TypeCode

public void write_TypeCode(org.omg.CORBA.TypeCode value)

write_any

public void write_any(org.omg.CORBA.Any value)
To copy the any's contents to the stream write it's typecode followed with a call to any.write_value.


write_Context

public void write_Context(org.omg.CORBA.Context ctx,
                          org.omg.CORBA.ContextList contexts)
Contexts are written like an array of strings, with name and value pairs for each context.


write_Principal

public void write_Principal(org.omg.CORBA.Principal value)
Deprecated. Deprecated by CORBA 2.2


write_fixed

public void write_fixed(java.math.BigDecimal value)

write_fixed

public void write_fixed(java.math.BigDecimal val,
                        org.omg.CORBA.TypeCode tc)
Description copied from interface: ExtendedOutputStream
Fixes problems in old write_fixed. see http://www.omg.org/issues/issue3431.txt

Specified by:
write_fixed in interface ExtendedOutputStream
Throws:
org.omg.CORBA.BAD_PARAM - Typecode is not fixed type or value out of range of type.

write_fixed

public void write_fixed(java.math.BigDecimal val,
                        short digits,
                        short scale)
Description copied from interface: ExtendedOutputStream
Fixes problems in old write_fixed. see http://www.omg.org/issues/issue3431.txt

Specified by:
write_fixed in interface ExtendedOutputStream
Throws:
org.omg.CORBA.BAD_PARAM - Value out of range of type.

write_value

public void write_value(java.io.Serializable value)
Valuetypes are stored as a TCKind.tk_value kind followed by a reference to the value. Boxed valuetypes are stored as a TCKind.tk_value_box, followed by the box helper, followed by the contents of the valuebox as written by the helper.

This function will find the valuebox helper if the valuetype is a valuebox type.


write_value

public void write_value(java.io.Serializable value,
                        java.lang.String repositoryId)
Valuetypes are stored as a TCKind.tk_value kind followed by a reference to the value. Boxed valuetypes are stored as a TCKind.tk_value_box, followed by the box helper, followed by the contents of the valuebox as written by the helper.

This function will find the valuebox helper if the valuetype is a valuebox type.


write_value

public void write_value(java.io.Serializable value,
                        java.lang.Class clz)

write_value

public void write_value(java.io.Serializable value,
                        org.omg.CORBA.portable.BoxedValueHelper boxhelp)
Boxed valuetypes are stored as a TCKind.tk_value_box, followed by the box helper, followed by the contents of the valuebox as written by the helper.

This function will find the valuebox helper if the valuetype is a valuebox type.


write_abstract_interface

public void write_abstract_interface(java.lang.Object object)
Abstract interfaces are written as a TCKind.tk_abstract_interface kind, followed by a TCKind.tk_objref and the reference for objects or a TCKind.tk_value and the value for valuetypes.


equals

public boolean equals(java.lang.Object obj)
Comparisons to ListInputStreams and ListOutputStreams are possible.