1 /*
   2  * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.corba.se.impl.encoding;
  26 
  27 import java.io.IOException;
  28 
  29 import org.omg.CORBA.TypeCode;
  30 import org.omg.CORBA.Principal;
  31 import org.omg.CORBA.Any;
  32 
  33 import org.omg.CORBA.portable.InputStream;
  34 
  35 public interface MarshalOutputStream {
  36 
  37     public InputStream create_input_stream();
  38 
  39     public void write_boolean(boolean value);
  40     public void write_char(char value);
  41     public void write_wchar(char value);
  42     public void write_octet(byte value);
  43     public void write_short(short value);
  44     public void write_ushort(short value);
  45     public void write_long(int value);
  46     public void write_ulong(int value);
  47     public void write_longlong(long value);
  48     public void write_ulonglong(long value);
  49     public void write_float(float value);
  50     public void write_double(double value);
  51     public void write_string(String value);
  52     public void write_wstring(String value);
  53 
  54     public void write_boolean_array(boolean[] value, int offset, int length);
  55     public void write_char_array(char[] value, int offset, int length);
  56     public void write_wchar_array(char[] value, int offset, int length);
  57     public void write_octet_array(byte[] value, int offset, int length);
  58     public void write_short_array(short[] value, int offset, int length);
  59     public void write_ushort_array(short[] value, int offset, int length);
  60     public void write_long_array(int[] value, int offset, int length);
  61     public void write_ulong_array(int[] value, int offset, int length);
  62     public void write_longlong_array(long[] value, int offset, int length);
  63     public void write_ulonglong_array(long[] value, int offset, int length);
  64     public void write_float_array(float[] value, int offset, int length);
  65     public void write_double_array(double[] value, int offset, int length);
  66 
  67     public void write_Object(org.omg.CORBA.Object value);
  68     public void write_TypeCode(TypeCode value);
  69     public void write_any(Any value);
  70     public void write_Principal(Principal value);
  71 
  72 
  73     /*
  74      * The methods necessary to support RMI
  75      */
  76     public void write_value(java.io.Serializable value);
  77     public void start_block();
  78     public void end_block();
  79 
  80     /*
  81      * Additional Methods
  82      */
  83 
  84     public void   putEndian();
  85     public void   writeTo(java.io.OutputStream s)
  86         throws IOException;
  87 
  88     public byte[] toByteArray();
  89 }