1:
37:
38:
39: package ;
40:
41: import ;
42:
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54: import ;
55: import ;
56: import ;
57: import ;
58: import ;
59: import ;
60: import ;
61: import ;
62: import ;
63: import ;
64: import ;
65:
66: import ;
67: import ;
68: import ;
69:
70:
80: public class HeadlessInput
81: extends org.omg.CORBA_2_3.portable.InputStream
82: implements DataInputStream, gnuValueStream
83: {
84:
87: private static final long serialVersionUID = 1;
88:
89:
92: static final int NONE = -1;
93:
94:
97: public boolean subsequentCalls;
98:
99:
102: final BufferredCdrInput stream;
103:
104:
111: public HeadlessInput(BufferredCdrInput a_stream, InputStream inheritSettings)
112: {
113: stream = a_stream;
114:
115: if (inheritSettings instanceof AbstractCdrInput)
116: {
117: AbstractCdrInput t = (AbstractCdrInput) inheritSettings;
118: t.cloneSettings(stream);
119: }
120: else if (stream.orb() == null)
121: stream.setOrb(inheritSettings.orb());
122:
123: if (inheritSettings instanceof gnuValueStream
124: && stream.getRunTime() == null)
125: {
126: stream.setRunTime(((gnuValueStream) inheritSettings).getRunTime());
127: }
128: }
129:
130:
133: public Serializable read_value(BoxedValueHelper helper)
134: {
135: if (subsequentCalls)
136: return stream.read_value(helper);
137: else
138: {
139: subsequentCalls = true;
140: return helper.read_value(this);
141: }
142: }
143:
144:
147: public Serializable read_value(String repository_id)
148: {
149: if (subsequentCalls)
150: return stream.read_value(repository_id);
151: else
152: {
153: subsequentCalls = true;
154: Serializable value = Vio.readValue(this, NONE, null,
155: null, repository_id, null, null);
156: return value;
157: }
158: }
159:
160:
163: public Serializable read_value(Serializable value)
164: {
165: if (subsequentCalls)
166: return stream.read_value(value);
167: else
168: {
169: subsequentCalls = true;
170: value = Vio.readValue(this, NONE, value, null, null,
171: null, null);
172: return value;
173: }
174: }
175:
176:
179: public Serializable read_value(Class clz)
180: {
181: if (subsequentCalls)
182: return stream.read_value(clz);
183: else
184: {
185: try
186: {
187: subsequentCalls = true;
188: Serializable value = (Serializable) Vio.instantiateAnyWay(clz);
189: value = Vio.readValue(this, NONE, value, null, null,
190: null, null);
191: return value;
192: }
193: catch (Exception ex)
194: {
195: MARSHAL m = new MARSHAL("Can't read an instance of "
196: + clz.getName());
197: m.minor = Minor.Value;
198: m.initCause(ex);
199: throw m;
200: }
201: }
202: }
203:
204:
207: public int available()
208: throws IOException
209: {
210: return stream.available();
211: }
212:
213:
216: public void close()
217: throws IOException
218: {
219: stream.close();
220: }
221:
222:
225: public void mark(int readlimit)
226: {
227: stream.mark(readlimit);
228: }
229:
230:
233: public boolean markSupported()
234: {
235: return stream.markSupported();
236: }
237:
238:
241: public ORB orb()
242: {
243: return stream.orb();
244: }
245:
246:
249: public Object read_abstract_interface()
250: {
251: return stream.read_abstract_interface();
252: }
253:
254:
257: public Object read_abstract_interface(Class clz)
258: {
259: return stream.read_abstract_interface(clz);
260: }
261:
262:
265: public Any read_any()
266: {
267: return stream.read_any();
268: }
269:
270:
273: public void read_boolean_array(boolean[] value, int offset, int length)
274: {
275: stream.read_boolean_array(value, offset, length);
276: }
277:
278:
281: public boolean read_boolean()
282: {
283: return stream.read_boolean();
284: }
285:
286:
289: public void read_char_array(char[] value, int offset, int length)
290: {
291: stream.read_char_array(value, offset, length);
292: }
293:
294:
297: public char read_char()
298: {
299: return stream.read_char();
300: }
301:
302:
305: public Context read_Context()
306: {
307: return stream.read_Context();
308: }
309:
310:
313: public void read_double_array(double[] value, int offset, int length)
314: {
315: stream.read_double_array(value, offset, length);
316: }
317:
318:
321: public double read_double()
322: {
323: return stream.read_double();
324: }
325:
326:
329: public BigDecimal read_fixed()
330: {
331: return stream.read_fixed();
332: }
333:
334:
337: public void read_float_array(float[] value, int offset, int length)
338: {
339: stream.read_float_array(value, offset, length);
340: }
341:
342:
345: public float read_float()
346: {
347: return stream.read_float();
348: }
349:
350:
353: public void read_long_array(int[] value, int offset, int length)
354: {
355: stream.read_long_array(value, offset, length);
356: }
357:
358:
361: public int read_long()
362: {
363: return stream.read_long();
364: }
365:
366:
369: public void read_longlong_array(long[] value, int offset, int length)
370: {
371: stream.read_longlong_array(value, offset, length);
372: }
373:
374:
377: public long read_longlong()
378: {
379: return stream.read_longlong();
380: }
381:
382:
385: public org.omg.CORBA.Object read_Object()
386: {
387: return stream.read_Object();
388: }
389:
390:
393: public org.omg.CORBA.Object read_Object(Class klass)
394: {
395: return stream.read_Object(klass);
396: }
397:
398:
401: public void read_octet_array(byte[] value, int offset, int length)
402: {
403: stream.read_octet_array(value, offset, length);
404: }
405:
406:
409: public byte read_octet()
410: {
411: return stream.read_octet();
412: }
413:
414:
417: public Principal read_Principal()
418: {
419: return stream.read_Principal();
420: }
421:
422:
425: public void read_short_array(short[] value, int offset, int length)
426: {
427: stream.read_short_array(value, offset, length);
428: }
429:
430:
433: public short read_short()
434: {
435: return stream.read_short();
436: }
437:
438:
441: public String read_string()
442: {
443: return stream.read_string();
444: }
445:
446:
449: public TypeCode read_TypeCode()
450: {
451: return stream.read_TypeCode();
452: }
453:
454:
457: public void read_ulong_array(int[] value, int offset, int length)
458: {
459: stream.read_ulong_array(value, offset, length);
460: }
461:
462:
465: public int read_ulong()
466: {
467: return stream.read_ulong();
468: }
469:
470:
473: public void read_ulonglong_array(long[] value, int offset, int length)
474: {
475: stream.read_ulonglong_array(value, offset, length);
476: }
477:
478:
481: public long read_ulonglong()
482: {
483: return stream.read_ulonglong();
484: }
485:
486:
489: public void read_ushort_array(short[] value, int offset, int length)
490: {
491: stream.read_ushort_array(value, offset, length);
492: }
493:
494:
497: public short read_ushort()
498: {
499: return stream.read_ushort();
500: }
501:
502:
505: public Serializable read_value()
506: {
507: return read_value((Serializable) null);
508: }
509:
510:
513: public void read_wchar_array(char[] value, int offset, int length)
514: {
515: stream.read_wchar_array(value, offset, length);
516: }
517:
518:
521: public char read_wchar()
522: {
523: return stream.read_wchar();
524: }
525:
526:
529: public String read_wstring()
530: {
531: return stream.read_wstring();
532: }
533:
534:
537: public int read()
538: throws IOException
539: {
540: return stream.read();
541: }
542:
543:
546: public int read(byte[] b, int off, int len)
547: throws IOException
548: {
549: return stream.read(b, off, len);
550: }
551:
552:
555: public int read(byte[] b)
556: throws IOException
557: {
558: return stream.read(b);
559: }
560:
561:
564: public void reset()
565: throws IOException
566: {
567: stream.reset();
568: }
569:
570:
573: public long skip(long n)
574: throws IOException
575: {
576: return stream.skip(n);
577: }
578:
579:
582: public String toString()
583: {
584: return "HeadlessInput+" + stream.toString();
585: }
586:
587:
590: public String[] _truncatable_ids()
591: {
592: return stream._truncatable_ids();
593: }
594:
595:
598: public Object read_Abstract()
599: {
600: return stream.read_Abstract();
601: }
602:
603:
606: public void read_any_array(AnySeqHolder holder, int offset, int length)
607: {
608: stream.read_any_array(holder, offset, length);
609: }
610:
611:
614: public void read_boolean_array(BooleanSeqHolder holder, int offset, int length)
615: {
616: stream.read_boolean_array(holder, offset, length);
617: }
618:
619:
622: public void read_char_array(CharSeqHolder holder, int offset, int length)
623: {
624: stream.read_char_array(holder, offset, length);
625: }
626:
627:
630: public void read_double_array(DoubleSeqHolder holder, int offset, int length)
631: {
632: stream.read_double_array(holder, offset, length);
633: }
634:
635:
638: public void read_float_array(FloatSeqHolder holder, int offset, int length)
639: {
640: stream.read_float_array(holder, offset, length);
641: }
642:
643:
646: public void read_long_array(LongSeqHolder holder, int offset, int length)
647: {
648: stream.read_long_array(holder, offset, length);
649: }
650:
651:
654: public void read_longlong_array(LongLongSeqHolder holder, int offset,
655: int length)
656: {
657: stream.read_longlong_array(holder, offset, length);
658: }
659:
660:
663: public void read_octet_array(OctetSeqHolder holder, int offset, int length)
664: {
665: stream.read_octet_array(holder, offset, length);
666: }
667:
668:
671: public void read_short_array(ShortSeqHolder holder, int offset, int length)
672: {
673: stream.read_short_array(holder, offset, length);
674: }
675:
676:
679: public void read_ulong_array(ULongSeqHolder holder, int offset, int length)
680: {
681: stream.read_ulong_array(holder, offset, length);
682: }
683:
684:
687: public void read_ulonglong_array(ULongLongSeqHolder holder, int offset,
688: int length)
689: {
690: stream.read_ulonglong_array(holder, offset, length);
691: }
692:
693:
696: public void read_ushort_array(UShortSeqHolder holder, int offset, int length)
697: {
698: stream.read_ushort_array(holder, offset, length);
699: }
700:
701:
704: public Serializable read_Value()
705: {
706: return read_value();
707: }
708:
709:
712: public void read_wchar_array(WCharSeqHolder holder, int offset, int length)
713: {
714: stream.read_wchar_array(holder, offset, length);
715: }
716:
717:
720: public int getPosition()
721: {
722: return stream.getPosition();
723: }
724:
725:
728: public gnuRuntime getRunTime()
729: {
730: return stream.runtime;
731: }
732:
733:
736: public void setRunTime(gnuRuntime a_runtime)
737: {
738: stream.runtime = a_runtime;
739: }
740:
741:
744: public void seek(int position)
745: {
746: stream.seek(position);
747: }
748:
749: }