KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > encoding > CDRInputStreamBase


1 /*
2  * @(#)CDRInputStreamBase.java 1.17 04/03/01
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.corba.se.impl.encoding;
8
9 import java.io.IOException JavaDoc;
10 import java.io.Serializable JavaDoc;
11 import java.math.BigDecimal JavaDoc;
12 import java.nio.ByteBuffer JavaDoc;
13
14 import org.omg.CORBA.TypeCode JavaDoc;
15 import org.omg.CORBA.Principal JavaDoc;
16 import org.omg.CORBA.Any JavaDoc;
17
18 import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
19 import com.sun.corba.se.impl.orbutil.ORBConstants;
20 import com.sun.org.omg.SendingContext.CodeBase;
21
22 /**
23  * Describes CDRInputStream delegates and provides some
24  * implementation. Non-default constructors are avoided in
25  * the delegation to separate instantiation from initialization,
26  * so we use init methods.
27  */

28 abstract class CDRInputStreamBase extends java.io.InputStream JavaDoc
29 {
30     protected CDRInputStream parent;
31
32     public void setParent(CDRInputStream parent) {
33         this.parent = parent;
34     }
35
36     public abstract void init(org.omg.CORBA.ORB JavaDoc orb,
37                               ByteBuffer JavaDoc byteBuffer,
38                               int size,
39                               boolean littleEndian,
40                               BufferManagerRead bufferManager);
41
42     // org.omg.CORBA.portable.InputStream
43
public abstract boolean read_boolean();
44     public abstract char read_char();
45     public abstract char read_wchar();
46     public abstract byte read_octet();
47     public abstract short read_short();
48     public abstract short read_ushort();
49     public abstract int read_long();
50     public abstract int read_ulong();
51     public abstract long read_longlong();
52     public abstract long read_ulonglong();
53     public abstract float read_float();
54     public abstract double read_double();
55     public abstract String JavaDoc read_string();
56     public abstract String JavaDoc read_wstring();
57     public abstract void read_boolean_array(boolean[] value, int offset, int length);
58     public abstract void read_char_array(char[] value, int offset, int length);
59     public abstract void read_wchar_array(char[] value, int offset, int length);
60     public abstract void read_octet_array(byte[] value, int offset, int length);
61     public abstract void read_short_array(short[] value, int offset, int length);
62     public abstract void read_ushort_array(short[] value, int offset, int length);
63     public abstract void read_long_array(int[] value, int offset, int length);
64     public abstract void read_ulong_array(int[] value, int offset, int length);
65     public abstract void read_longlong_array(long[] value, int offset, int length);
66     public abstract void read_ulonglong_array(long[] value, int offset, int length);
67     public abstract void read_float_array(float[] value, int offset, int length);
68     public abstract void read_double_array(double[] value, int offset, int length);
69     public abstract org.omg.CORBA.Object JavaDoc read_Object();
70     public abstract TypeCode JavaDoc read_TypeCode();
71     public abstract Any JavaDoc read_any();
72     public abstract Principal JavaDoc read_Principal();
73     public int read() throws java.io.IOException JavaDoc {
74         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
75     }
76     public abstract java.math.BigDecimal JavaDoc read_fixed();
77     public org.omg.CORBA.Context JavaDoc read_Context() {
78         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
79     }
80     public abstract org.omg.CORBA.Object JavaDoc read_Object(java.lang.Class JavaDoc clz);
81     public abstract org.omg.CORBA.ORB JavaDoc orb();
82
83     // org.omg.CORBA_2_3.portable.InputStream
84
public abstract java.io.Serializable JavaDoc read_value();
85     public abstract java.io.Serializable JavaDoc read_value(java.lang.Class JavaDoc clz);
86     public abstract java.io.Serializable JavaDoc read_value(org.omg.CORBA.portable.BoxedValueHelper JavaDoc factory);
87     public abstract java.io.Serializable JavaDoc read_value(java.lang.String JavaDoc rep_id);
88     public abstract java.io.Serializable JavaDoc read_value(java.io.Serializable JavaDoc value);
89     public abstract java.lang.Object JavaDoc read_abstract_interface();
90     public abstract java.lang.Object JavaDoc read_abstract_interface(java.lang.Class JavaDoc clz);
91
92     // com.sun.corba.se.impl.encoding.MarshalInputStream
93
public abstract void consumeEndian();
94     public abstract int getPosition();
95
96     // org.omg.CORBA.DataInputStream
97
public abstract java.lang.Object JavaDoc read_Abstract ();
98     public abstract java.io.Serializable JavaDoc read_Value ();
99     public abstract void read_any_array (org.omg.CORBA.AnySeqHolder JavaDoc seq, int offset, int length);
100     public abstract void read_boolean_array (org.omg.CORBA.BooleanSeqHolder JavaDoc seq, int offset, int length);
101     public abstract void read_char_array (org.omg.CORBA.CharSeqHolder JavaDoc seq, int offset, int length);
102     public abstract void read_wchar_array (org.omg.CORBA.WCharSeqHolder JavaDoc seq, int offset, int length);
103     public abstract void read_octet_array (org.omg.CORBA.OctetSeqHolder JavaDoc seq, int offset, int length);
104     public abstract void read_short_array (org.omg.CORBA.ShortSeqHolder JavaDoc seq, int offset, int length);
105     public abstract void read_ushort_array (org.omg.CORBA.UShortSeqHolder JavaDoc seq, int offset, int length);
106     public abstract void read_long_array (org.omg.CORBA.LongSeqHolder JavaDoc seq, int offset, int length);
107     public abstract void read_ulong_array (org.omg.CORBA.ULongSeqHolder JavaDoc seq, int offset, int length);
108     public abstract void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder JavaDoc seq, int offset, int length);
109     public abstract void read_longlong_array (org.omg.CORBA.LongLongSeqHolder JavaDoc seq, int offset, int length);
110     public abstract void read_float_array (org.omg.CORBA.FloatSeqHolder JavaDoc seq, int offset, int length);
111     public abstract void read_double_array (org.omg.CORBA.DoubleSeqHolder JavaDoc seq, int offset, int length);
112
113     // org.omg.CORBA.portable.ValueBase
114
public abstract String JavaDoc[] _truncatable_ids();
115
116     // java.io.InputStream
117
// REVISIT - should we make these throw UnsupportedOperationExceptions?
118
// Right now, they'll go up to the java.io versions!
119

120 // public abstract int read(byte b[]) throws IOException;
121
// public abstract int read(byte b[], int off, int len) throws IOException
122
// public abstract long skip(long n) throws IOException;
123
// public abstract int available() throws IOException;
124
// public abstract void close() throws IOException;
125
public abstract void mark(int readlimit);
126     public abstract void reset();
127
128     // This should return false so that outside users (people using the JDK)
129
// don't have any guarantees that mark/reset will work in their
130
// custom marshaling code. This is necessary since they could do things
131
// like expect obj1a == obj1b in the following code:
132
//
133
// is.mark(10000);
134
// Object obj1a = is.readObject();
135
// is.reset();
136
// Object obj1b = is.readObject();
137
//
138
public boolean markSupported() { return false; }
139
140     // Needed by AnyImpl and ServiceContexts
141
public abstract CDRInputStreamBase dup();
142
143     // Needed by TCUtility
144
public abstract java.math.BigDecimal JavaDoc read_fixed(short digits, short scale);
145
146     // Needed by TypeCodeImpl
147
public abstract boolean isLittleEndian();
148
149     // Needed by request and reply messages for GIOP versions >= 1.2 only.
150
abstract void setHeaderPadding(boolean headerPadding);
151     
152     // Needed by IIOPInputStream and other subclasses
153

154     public abstract ByteBuffer JavaDoc getByteBuffer();
155     public abstract void setByteBuffer(ByteBuffer JavaDoc byteBuffer);
156
157     public abstract void setByteBufferWithInfo(ByteBufferWithInfo bbwi);
158
159     public abstract int getBufferLength();
160     public abstract void setBufferLength(int value);
161
162     public abstract int getIndex();
163     public abstract void setIndex(int value);
164
165     public abstract void orb(org.omg.CORBA.ORB JavaDoc orb);
166
167     public abstract BufferManagerRead getBufferManager();
168     public abstract GIOPVersion getGIOPVersion();
169
170     abstract CodeBase getCodeBase();
171
172     abstract void printBuffer();
173
174     abstract void alignOnBoundary(int octetBoundary);
175
176     abstract void performORBVersionSpecificInit();
177
178     public abstract void resetCodeSetConverters();
179
180     // ValueInputStream -------------------------
181
public abstract void start_value();
182     public abstract void end_value();
183 }
184
Popular Tags