KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)CDROutputStreamBase.java 1.18 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.spi.orb.ORB;
20
21 /**
22  * Describes CDROutputStream delegates and provides some
23  * implementation. Non-default constructors are avoided in
24  * the delegation to separate instantiation from initialization,
25  * so we use init methods.
26  */

27 abstract class CDROutputStreamBase extends java.io.OutputStream JavaDoc
28 {
29     protected CDROutputStream parent;
30
31     // Required by parent CDROutputStream
32
public void setParent(CDROutputStream parent) {
33         this.parent = parent;
34     }
35
36     public void init(org.omg.CORBA.ORB JavaDoc orb,
37                      BufferManagerWrite bufferManager,
38                      byte streamFormatVersion) {
39         init(orb, false, bufferManager, streamFormatVersion, true);
40     }
41
42     // See EncapsOutputStream, the only one that uses the
43
// non-pooled ByteBuffers, for additional info.
44
protected abstract void init(org.omg.CORBA.ORB JavaDoc orb,
45                                  boolean littleEndian,
46                                  BufferManagerWrite bufferManager,
47                                  byte streamFormatVersion,
48                                  boolean usePooledByteBuffers);
49
50     public abstract void write_boolean(boolean value);
51     public abstract void write_char(char value);
52     public abstract void write_wchar(char value);
53     public abstract void write_octet(byte value);
54     public abstract void write_short(short value);
55     public abstract void write_ushort(short value);
56     public abstract void write_long(int value);
57     public abstract void write_ulong(int value);
58     public abstract void write_longlong(long value);
59     public abstract void write_ulonglong(long value);
60     public abstract void write_float(float value);
61     public abstract void write_double(double value);
62     public abstract void write_string(String JavaDoc value);
63     public abstract void write_wstring(String JavaDoc value);
64     public abstract void write_boolean_array(boolean[] value, int offset, int length);
65     public abstract void write_char_array(char[] value, int offset, int length);
66     public abstract void write_wchar_array(char[] value, int offset, int length);
67     public abstract void write_octet_array(byte[] value, int offset, int length);
68     public abstract void write_short_array(short[] value, int offset, int length);
69     public abstract void write_ushort_array(short[] value, int offset, int length);
70     public abstract void write_long_array(int[] value, int offset, int length);
71     public abstract void write_ulong_array(int[] value, int offset, int length);
72     public abstract void write_longlong_array(long[] value, int offset, int length);
73     public abstract void write_ulonglong_array(long[] value, int offset, int length);
74     public abstract void write_float_array(float[] value, int offset, int length);
75     public abstract void write_double_array(double[] value, int offset, int length);
76     public abstract void write_Object(org.omg.CORBA.Object JavaDoc value);
77     public abstract void write_TypeCode(TypeCode JavaDoc value);
78     public abstract void write_any(Any JavaDoc value);
79     public abstract void write_Principal(Principal JavaDoc value);
80     public void write(int b) throws java.io.IOException JavaDoc {
81         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
82     }
83     public abstract void write_fixed(java.math.BigDecimal JavaDoc value);
84     public void write_Context(org.omg.CORBA.Context JavaDoc ctx,
85                               org.omg.CORBA.ContextList JavaDoc contexts) {
86         throw new org.omg.CORBA.NO_IMPLEMENT JavaDoc();
87     }
88
89     public abstract org.omg.CORBA.ORB JavaDoc orb();
90
91     // org.omg.CORBA_2_3.portable.OutputStream
92
public abstract void write_value(java.io.Serializable JavaDoc value);
93     public abstract void write_value(java.io.Serializable JavaDoc value, java.lang.Class JavaDoc clz);
94     public abstract void write_value(java.io.Serializable JavaDoc value, String JavaDoc repository_id);
95     public abstract void write_value(java.io.Serializable JavaDoc value,
96                                      org.omg.CORBA.portable.BoxedValueHelper JavaDoc factory);
97     public abstract void write_abstract_interface(java.lang.Object JavaDoc obj);
98
99     // java.io.OutputStream
100
// public abstract void write(byte b[]) throws IOException;
101
// public abstract void write(byte b[], int off, int len) throws IOException;
102
// public abstract void flush() throws IOException;
103
// public abstract void close() throws IOException;
104

105     // com.sun.corba.se.impl.encoding.MarshalOutputStream
106
public abstract void start_block();
107     public abstract void end_block();
108     public abstract void putEndian();
109     public abstract void writeTo(java.io.OutputStream JavaDoc s)
110     throws IOException JavaDoc;
111     public abstract byte[] toByteArray();
112
113     // org.omg.CORBA.DataOutputStream
114
public abstract void write_Abstract (java.lang.Object JavaDoc value);
115     public abstract void write_Value (java.io.Serializable JavaDoc value);
116     public abstract void write_any_array(org.omg.CORBA.Any JavaDoc[] seq, int offset, int length);
117
118     // org.omg.CORBA.portable.ValueBase
119
public abstract String JavaDoc[] _truncatable_ids();
120
121     // Needed by request and reply messages for GIOP versions >= 1.2 only.
122
abstract void setHeaderPadding(boolean headerPadding);
123     
124     // Required by IIOPOutputStream and other subclasses
125
public abstract int getSize();
126
127     public abstract int getIndex();
128     public abstract void setIndex(int value);
129
130     public abstract ByteBuffer JavaDoc getByteBuffer();
131     public abstract void setByteBuffer(ByteBuffer JavaDoc byteBuffer);
132
133     public abstract boolean isLittleEndian();
134
135     public abstract ByteBufferWithInfo getByteBufferWithInfo();
136     public abstract void setByteBufferWithInfo(ByteBufferWithInfo bbwi);
137
138     public abstract BufferManagerWrite getBufferManager();
139
140     public abstract void write_fixed(java.math.BigDecimal JavaDoc bigDecimal, short digits, short scale);
141     public abstract void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream JavaDoc s);
142
143     public abstract GIOPVersion getGIOPVersion();
144
145     public abstract void writeIndirection(int tag, int posIndirectedTo);
146
147     abstract void freeInternalCaches();
148
149     abstract void printBuffer();
150
151     abstract void alignOnBoundary(int octetBoundary);
152
153     // org.omg.CORBA.portable.ValueOutputStream
154

155     public abstract void start_value(String JavaDoc rep_id);
156
157     public abstract void end_value();
158 }
159
160
Popular Tags