# OpenORB 1.3.1: Class ListOutputStream

## org.openorb.io
Class ListOutputStream

    java.lang.Object
      |
      +--java.io.OutputStream
            |
            +--org.omg.CORBA.portable.OutputStream
                  |
                  +--org.omg.CORBA_2_3.portable.OutputStream
                        |
                        +--org.openorb.io.ListOutputStream

All Implemented Interfaces:
  ExtendedOutputStream

public class ListOutputStream
extends 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.20 $ $Date: 2002/07/14 19:12:35 $
Author:
  Chris Wood

Constructor Summary
`ListOutputStream(ORB orb)` Create new output stream.
`ListOutputStream(ORB orb, java.util.List contents)` Create new output stream with destination list.

Method Summary
`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.
`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(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(Context ctx, 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, 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(Object value)`
`void` `write_octet_array(byte[] val, int off, int len)`
`void` `write_octet(byte i)`
`void` `write_Principal(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(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, 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
`getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ListOutputStream

    public ListOutputStream(ORB orb)

  Create new output stream.

### ListOutputStream

    public ListOutputStream(ORB orb,
                            java.util.List contents)

  Create new output stream with destination list.

Method Detail

### orb

    public ORB orb()

  Get the orb associated with the stream.
  Specified by:
    `orb` in interface `ExtendedOutputStream`
  Overrides:
    `orb` in class `OutputStream`

### create_input_stream

    public InputStream create_input_stream()

  Create a new input stream from the data inserted into this stream. Both streams will share the list data.
  Overrides:
    `create_input_stream` in class `OutputStream`

### write_boolean

    public void write_boolean(boolean i)

  Overrides:
    `write_boolean` in class `OutputStream`

### write_boolean_array

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

  Overrides:
    `write_boolean_array` in class `OutputStream`

### write_octet

    public void write_octet(byte i)

  Overrides:
    `write_octet` in class `OutputStream`

### write_octet_array

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

  Overrides:
    `write_octet_array` in class `OutputStream`

### write_short

    public void write_short(short i)

  Overrides:
    `write_short` in class `OutputStream`

### write_short_array

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

  Overrides:
    `write_short_array` in class `OutputStream`

### write_ushort

    public void write_ushort(short i)

  Overrides:
    `write_ushort` in class `OutputStream`

### write_ushort_array

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

  Overrides:
    `write_ushort_array` in class `OutputStream`

### write_long

    public void write_long(int i)

  Overrides:
    `write_long` in class `OutputStream`

### write_long_array

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

  Overrides:
    `write_long_array` in class `OutputStream`

### write_ulong

    public void write_ulong(int i)

  Overrides:
    `write_ulong` in class `OutputStream`

### write_ulong_array

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

  Overrides:
    `write_ulong_array` in class `OutputStream`

### write_longlong

    public void write_longlong(long i)

  Overrides:
    `write_longlong` in class `OutputStream`

### write_longlong_array

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

  Overrides:
    `write_longlong_array` in class `OutputStream`

### write_ulonglong

    public void write_ulonglong(long i)

  Overrides:
    `write_ulonglong` in class `OutputStream`

### write_ulonglong_array

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

  Overrides:
    `write_ulonglong_array` in class `OutputStream`

### write_float

    public void write_float(float i)

  Overrides:
    `write_float` in class `OutputStream`

### write_float_array

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

  Overrides:
    `write_float_array` in class `OutputStream`

### write_double

    public void write_double(double i)

  Overrides:
    `write_double` in class `OutputStream`

### write_double_array

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

  Overrides:
    `write_double_array` in class `OutputStream`

### write_char

    public void write_char(char i)

  Overrides:
    `write_char` in class `OutputStream`

### write_char_array

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

  Overrides:
    `write_char_array` in class `OutputStream`

### write_wchar

    public void write_wchar(char i)

  Overrides:
    `write_wchar` in class `OutputStream`

### write_wchar_array

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

  Overrides:
    `write_wchar_array` in class `OutputStream`

### write_string

    public void write_string(java.lang.String i)

  Overrides:
    `write_string` in class `OutputStream`

### write_wstring

    public void write_wstring(java.lang.String i)

  Overrides:
    `write_wstring` in class `OutputStream`

### write_Object

    public void write_Object(Object value)

  Overrides:
    `write_Object` in class `OutputStream`

### write_TypeCode

    public void write_TypeCode(TypeCode value)

  Overrides:
    `write_TypeCode` in class `OutputStream`

### write_any

    public void write_any(Any value)

  To copy the any's contents to the stream write it's typecode followed with a call to any.write_value.
  Overrides:
    `write_any` in class `OutputStream`

### write_Context

    public void write_Context(Context ctx,
                              ContextList contexts)

  Contexts are written like an array of strings, with name and value pairs for each context.
  Overrides:
    `write_Context` in class `OutputStream`

### write_Principal

    public void write_Principal(Principal value)

  Deprecated. Deprecated by CORBA 2.2

  Overrides:
    `write_Principal` in class `OutputStream`

### write_fixed

    public void write_fixed(java.math.BigDecimal value)

  Overrides:
    `write_fixed` in class `OutputStream`

### write_fixed

    public void write_fixed(java.math.BigDecimal val,
                            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:
    `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`
  Overrides:
    `write_fixed` in class `OutputStream`
  Throws:
    `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.

  Overrides:
    `write_value` in class `OutputStream`

### 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.

  Overrides:
    `write_value` in class `OutputStream`

### write_value

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

  Overrides:
    `write_value` in class `OutputStream`

### write_value

    public void write_value(java.io.Serializable value,
                            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.

  Overrides:
    `write_value` in class `OutputStream`

### 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.
  Overrides:
    `write_abstract_interface` in class `OutputStream`

### equals

    public boolean equals(java.lang.Object obj)

  Comparisons to ListInputStreams and ListOutputStreams are possible.
  Overrides:
    `equals` in class `java.lang.Object`