1:
37:
38:
39: package ;
40:
41: import ;
42:
43: import ;
44:
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50:
51:
57: public class CorbaInput
58: extends ObjectInputStream
59: implements ObjectInput
60: {
61:
62:
65: public InputStream stream;
66:
67:
70: final RmiUtilities util;
71:
72:
75: Object current;
76:
77:
80: int offset;
81:
82:
85: String rid;
86:
87:
90: gnuRuntime runtime;
91:
92:
95: public CorbaInput(InputStream an_input, Object firstObject,
96: RmiUtilities an_util, int an_offset, String a_rid,
97: gnuRuntime a_runtime)
98: throws Exception
99: {
100: stream = an_input;
101: current = firstObject;
102: util = an_util;
103:
104: offset = an_offset;
105: rid = a_rid;
106: runtime = a_runtime;
107: }
108:
109:
110: public int available()
111: throws IOException
112: {
113: return stream.available();
114: }
115:
116:
119: public void close()
120: throws IOException
121: {
122: }
123:
124:
125: public void defaultReadObject()
126: throws IOException, ClassNotFoundException
127: {
128: util.readFields(offset, rid, (Serializable) current, stream, runtime);
129: }
130:
131:
132: public void mark(int readlimit)
133: {
134: stream.mark(readlimit);
135: }
136:
137:
138: public boolean markSupported()
139: {
140: return stream.markSupported();
141: }
142:
143:
144: public int read()
145: throws IOException
146: {
147: return stream.read();
148: }
149:
150:
151: public int read(byte[] buf, int off, int len)
152: throws IOException
153: {
154: return stream.read(buf, off, len);
155: }
156:
157:
158: public int read(byte[] b)
159: throws IOException
160: {
161: return stream.read(b);
162: }
163:
164:
165: public boolean readBoolean()
166: throws IOException
167: {
168: return stream.read_boolean();
169: }
170:
171:
172: public byte readByte()
173: throws IOException
174: {
175: return (byte) stream.read();
176: }
177:
178:
179: public char readChar()
180: throws IOException
181: {
182: return stream.read_char();
183: }
184:
185:
186: public double readDouble()
187: throws IOException
188: {
189: return stream.read_double();
190: }
191:
192:
193: public float readFloat()
194: throws IOException
195: {
196: return stream.read_float();
197: }
198:
199:
200: public void readFully(byte[] buf, int off, int len)
201: throws IOException
202: {
203:
204: stream.read(buf, off, len);
205: }
206:
207:
208: public void readFully(byte[] buf)
209: throws IOException
210: {
211:
212: stream.read(buf);
213: }
214:
215:
216: public int readInt()
217: throws IOException
218: {
219: return stream.read_long();
220: }
221:
222:
223: public String readLine()
224: throws IOException
225: {
226: return new DataInputStream(this).readLine();
227: }
228:
229:
230: public long readLong()
231: throws IOException
232: {
233: return stream.read_longlong();
234: }
235:
236:
237: public short read_short()
238: throws IOException
239: {
240: return stream.read_short();
241: }
242:
243:
244: public int readUnsignedByte()
245: throws IOException
246: {
247: return (stream.read() & 0xFF);
248: }
249:
250:
251: public int readUnsignedShort()
252: throws IOException
253: {
254: return (stream.read_short() & 0xFFFF);
255: }
256:
257:
260: public String readUTF()
261: throws IOException
262: {
263: return stream.read_wstring();
264: }
265:
266:
267: public void reset()
268: throws IOException
269: {
270: stream.reset();
271: }
272:
273:
274: public long skip(long n)
275: throws IOException
276: {
277: return stream.skip(n);
278: }
279:
280:
281: public int skipBytes(int len)
282: throws IOException
283: {
284: return (int) stream.skip(len);
285: }
286:
287:
290: protected Object readObjectOverride()
291: throws IOException, ClassNotFoundException
292: {
293: current = stream.read_abstract_interface();
294: return current;
295: }
296:
297: }