corba/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStreamBase.java
author ohair
Tue, 25 May 2010 15:52:11 -0700
changeset 5555 b2b5ed3f0d0d
parent 4 02bb8761fcce
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     2
 * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
package com.sun.corba.se.impl.encoding;
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
import java.io.IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import java.io.Serializable;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
import java.math.BigDecimal;
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
import java.nio.ByteBuffer;
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
import org.omg.CORBA.TypeCode;
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
import org.omg.CORBA.Principal;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
import org.omg.CORBA.Any;
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import com.sun.corba.se.impl.orbutil.ORBConstants;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
import com.sun.org.omg.SendingContext.CodeBase;
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
 * Describes CDRInputStream delegates and provides some
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
 * implementation.  Non-default constructors are avoided in
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
 * the delegation to separate instantiation from initialization,
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 * so we use init methods.
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
abstract class CDRInputStreamBase extends java.io.InputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
{
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
    protected CDRInputStream parent;
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
    public void setParent(CDRInputStream parent) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
        this.parent = parent;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
    public abstract void init(org.omg.CORBA.ORB orb,
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
                              ByteBuffer byteBuffer,
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
                              int size,
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
                              boolean littleEndian,
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
                              BufferManagerRead bufferManager);
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
    // org.omg.CORBA.portable.InputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
    public abstract boolean read_boolean();
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
    public abstract char read_char();
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
    public abstract char read_wchar();
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
    public abstract byte read_octet();
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
    public abstract short read_short();
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
    public abstract short read_ushort();
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
    public abstract int read_long();
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
    public abstract int read_ulong();
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
    public abstract long read_longlong();
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
    public abstract long read_ulonglong();
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
    public abstract float read_float();
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
    public abstract double read_double();
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
    public abstract String read_string();
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
    public abstract String read_wstring();
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
    public abstract void read_boolean_array(boolean[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
    public abstract void read_char_array(char[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
    public abstract void read_wchar_array(char[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
    public abstract void read_octet_array(byte[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
    public abstract void read_short_array(short[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
    public abstract void read_ushort_array(short[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
    public abstract void read_long_array(int[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
    public abstract void read_ulong_array(int[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
    public abstract void read_longlong_array(long[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
    public abstract void read_ulonglong_array(long[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
    public abstract void read_float_array(float[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
    public abstract void read_double_array(double[] value, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
    public abstract org.omg.CORBA.Object read_Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
    public abstract TypeCode read_TypeCode();
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
    public abstract Any read_any();
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
    public abstract Principal read_Principal();
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
    public int read() throws java.io.IOException {
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
        throw new org.omg.CORBA.NO_IMPLEMENT();
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
    public abstract java.math.BigDecimal read_fixed();
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
    public org.omg.CORBA.Context read_Context() {
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
        throw new org.omg.CORBA.NO_IMPLEMENT();
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
    public abstract org.omg.CORBA.Object read_Object(java.lang.Class clz);
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
    public abstract org.omg.CORBA.ORB orb();
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
    // org.omg.CORBA_2_3.portable.InputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
    public abstract java.io.Serializable read_value();
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    public abstract java.io.Serializable read_value(java.lang.Class clz);
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
    public abstract java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory);
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    public abstract java.io.Serializable read_value(java.lang.String rep_id);
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
    public abstract java.io.Serializable read_value(java.io.Serializable value);
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    public abstract java.lang.Object read_abstract_interface();
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
    public abstract java.lang.Object read_abstract_interface(java.lang.Class clz);
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
    // com.sun.corba.se.impl.encoding.MarshalInputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    public abstract void consumeEndian();
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    public abstract int getPosition();
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    // org.omg.CORBA.DataInputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
    public abstract java.lang.Object read_Abstract ();
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    public abstract java.io.Serializable read_Value ();
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
    public abstract void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    public abstract void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
    public abstract void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
    public abstract void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
    public abstract void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    public abstract void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
    public abstract void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
    public abstract void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
    public abstract void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
    public abstract void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    public abstract void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
    public abstract void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    public abstract void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length);
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
    // org.omg.CORBA.portable.ValueBase
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
    public abstract String[] _truncatable_ids();
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
    // java.io.InputStream
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
    // REVISIT - should we make these throw UnsupportedOperationExceptions?
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
    // Right now, they'll go up to the java.io versions!
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
//     public abstract int read(byte b[]) throws IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
//     public abstract int read(byte b[], int off, int len) throws IOException
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
//     public abstract long skip(long n) throws IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
//     public abstract int available() throws IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
//     public abstract void close() throws IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
    public abstract void mark(int readlimit);
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
    public abstract void reset();
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
    // This should return false so that outside users (people using the JDK)
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
    // don't have any guarantees that mark/reset will work in their
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
    // custom marshaling code.  This is necessary since they could do things
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
    // like expect obj1a == obj1b in the following code:
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
    // is.mark(10000);
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    // Object obj1a = is.readObject();
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
    // is.reset();
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
    // Object obj1b = is.readObject();
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
    public boolean markSupported() { return false; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
    // Needed by AnyImpl and ServiceContexts
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
    public abstract CDRInputStreamBase dup();
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
    // Needed by TCUtility
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
    public abstract java.math.BigDecimal read_fixed(short digits, short scale);
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
    // Needed by TypeCodeImpl
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
    public abstract boolean isLittleEndian();
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
    // Needed by request and reply messages for GIOP versions >= 1.2 only.
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
    abstract void setHeaderPadding(boolean headerPadding);
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
    // Needed by IIOPInputStream and other subclasses
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
    public abstract ByteBuffer getByteBuffer();
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
    public abstract void setByteBuffer(ByteBuffer byteBuffer);
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
    public abstract void setByteBufferWithInfo(ByteBufferWithInfo bbwi);
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
    public abstract int getBufferLength();
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
    public abstract void setBufferLength(int value);
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
    public abstract int getIndex();
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
    public abstract void setIndex(int value);
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    public abstract void orb(org.omg.CORBA.ORB orb);
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
    public abstract BufferManagerRead getBufferManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
    public abstract GIOPVersion getGIOPVersion();
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
    abstract CodeBase getCodeBase();
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
    abstract void printBuffer();
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
    abstract void alignOnBoundary(int octetBoundary);
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
    abstract void performORBVersionSpecificInit();
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
    public abstract void resetCodeSetConverters();
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
    // ValueInputStream -------------------------
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
    public abstract void start_value();
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
    public abstract void end_value();
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
}