Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.io.OutputStream
org.omg.CORBA.portable.OutputStream
org.omg.CORBA_2_3.portable.OutputStream
gnu.CORBA.CDR.AbstractCdrOutput
OutputStream
.
The same class also implements the DataInputStream
,
providing support for writing the value type objects
in a user defined way.
TODO This class uses 16 bits per Unicode character only, as it was until
jdk 1.4 inclusive.
Field Summary | |
protected AbstractDataOutput |
|
protected CodeSetServiceContext |
|
protected Version |
|
protected ORB |
|
gnuRuntime |
|
Constructor Summary | |
| |
|
Method Summary | |
String[] |
|
abstract void |
|
void |
|
AbstractCdrOutput |
|
CodeSetServiceContext |
|
ORB | |
void |
|
void |
|
abstract void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.omg.CORBA_2_3.portable.OutputStream | |
write_abstract_interface , write_value , write_value , write_value |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected AbstractDataOutput b
This instance is used to convert primitive data types into the byte sequences.
public gnuRuntime runtime
The runtime, associated with this stream. This field is only used when reading and writing value types and filled-in in gnu.CORBA.CDR.Vio.
public AbstractCdrOutput()
Creates the stream, requiring the subsequent call ofsetOutputStream(OutputStream)
.
public AbstractCdrOutput(OutputStream writeTo)
Creates the stream.
- Parameters:
writeTo
- a stream to write CORBA output to.
public String[] _truncatable_ids()
Get the truncatable repository ids.
- Specified by:
- _truncatable_ids in interface ValueBase
- Returns:
- the array of repository ids, defining the base types, to that basic types this value base can be truncated.
public abstract void align(int boundary)
Align the curretn position at the given natural boundary.
public void cloneSettings(AbstractCdrOutput stream)
Clone all important settings to another stream.
public AbstractCdrOutput createEncapsulation()
Create the encapsulation stream, associated with the current stream. The encapsulated stream must be closed. When being closed, the encapsulation stream writes its buffer into this stream using the CORBA CDR encapsulation rules. It is not allowed to write to the current stream directly before the encapsulation stream is closed. The encoding (Big/Little Endian) inside the encapsulated sequence is the same as used into the parent stream.
- Returns:
- the encapsulated stream.
public ORB orb()
Return the associatedORB
.
- Overrides:
- orb in interface OutputStream
- Returns:
- the associated
ORB
or null is no such is set.
public void setBigEndian(boolean use_big_endian)
Specify if the stream should use the Big Endian (usual for java) or Little Encoding. The default is Big Endian.
- Parameters:
use_big_endian
- if true, use Big Endian, if false, use Little Endian.
public abstract void setOffset(int an_offset)
Set the alignment offset, if the index of the first byte in the stream is different from 0.
public void setOutputStream(OutputStream writeTo)
Set the output stream that receives the CORBA output.
- Parameters:
writeTo
- the stream.
public void setVersion(Version giop_version)
Set the GIOP version. Some data types are written differently for the different versions. The default version is 1.0 .
public void write(byte[] x) throws IOException
Write bytes directly into the underlying stream.
- Overrides:
- write in interface OutputStream
public void write(byte[] x, int ofs, int len) throws IOException
Write bytes directly into the underlying stream.
- Overrides:
- write in interface OutputStream
public void write(int n)
Write a single byte.
- Overrides:
- write in interface OutputStream
- Parameters:
n
- byte to write (low 8 bits are written).
public void write_Abstract(Object value)
- Specified by:
- write_Abstract in interface DataOutputStream
public void write_Context(Context context, ContextList contexts)
Following the specification, this is not implemented. Override to get the functionality.
- Overrides:
- write_Context in interface OutputStream
public void write_Object(Object x)
Read the CORBA object. The object is written form of the plain (not a string-encoded) IOR profile without the heading endian indicator. The responsible method for reading such data isIOR.write_no_endian
. The null value is written as defined in OMG specification (zero length string, followed by an empty set of profiles).
- Specified by:
- write_Object in interface DataOutputStream
- Overrides:
- write_Object in interface OutputStream
public void write_TypeCode(TypeCode x)
Write the TypeCode. This implementation delegates functionality tocdrTypeCode
.
- Specified by:
- write_TypeCode in interface DataOutputStream
- Overrides:
- write_TypeCode in interface OutputStream
- Parameters:
x
- a TypeCode to write.
public void write_Value(Serializable value)
- Specified by:
- write_Value in interface DataOutputStream
public void write_any(Any x)
Writes an instance of the CORBAAny
. This method writes the typecode, followed by value itself. In Any contains null (value not set), theTCKind.tk_null
is written.
- Specified by:
- write_any in interface DataOutputStream
- Overrides:
- write_any in interface OutputStream
- Parameters:
x
- theAny
to write.
public void write_any_array(Any[] anys, int offset, int length)
- Specified by:
- write_any_array in interface DataOutputStream
public void write_boolean(boolean x)
Writes a single byte, 0 forfalse
, 1 fortrue
.
- Specified by:
- write_boolean in interface DataOutputStream
- Overrides:
- write_boolean in interface OutputStream
- Parameters:
x
- the value to write
public void write_boolean_array(boolean[] x, int ofs, int len)
Writes the boolean array.
- Specified by:
- write_boolean_array in interface DataOutputStream
- Overrides:
- write_boolean_array in interface OutputStream
- Parameters:
x
- arrayofs
- offsetlen
- length.
public void write_char(char x)
Writes the lower byte of the passed parameter.
- Specified by:
- write_char in interface DataOutputStream
- Overrides:
- write_char in interface OutputStream
- Parameters:
x
- the char to write It is effective to write more characters at once.
public void write_char_array(char[] chars, int offset, int length)
Writes the lower bytes of the passed array members.
- Specified by:
- write_char_array in interface DataOutputStream
- Overrides:
- write_char_array in interface OutputStream
- Parameters:
chars
- an arrayoffset
- offsetlength
- length
public void write_double(double x)
Writes the double value (IEEE 754 format).
- Specified by:
- write_double in interface DataOutputStream
- Overrides:
- write_double in interface OutputStream
public void write_double_array(double[] x, int ofs, int len)
Writes the array of double values.
- Specified by:
- write_double_array in interface DataOutputStream
- Overrides:
- write_double_array in interface OutputStream
public void write_fixed(BigDecimal fixed)
Writes CORBA fixed, storing all digits but not the scale. The end of the record onfixed
can be determined from its last byte.
- Overrides:
- write_fixed in interface OutputStream
public void write_float(float x)
Write the float value (IEEE 754 format).
- Specified by:
- write_float in interface DataOutputStream
- Overrides:
- write_float in interface OutputStream
public void write_float_array(float[] x, int ofs, int len)
Writes an array of the float values.
- Specified by:
- write_float_array in interface DataOutputStream
- Overrides:
- write_float_array in interface OutputStream
public void write_long(int x)
Writes the integer value (CORBA long, four bytes, high byte first).
- Specified by:
- write_long in interface DataOutputStream
- Overrides:
- write_long in interface OutputStream
- Parameters:
x
- the value to write.
public void write_long_array(int[] x, int ofs, int len)
Writes the array of integer (CORBA long) values.
- Specified by:
- write_long_array in interface DataOutputStream
- Overrides:
- write_long_array in interface OutputStream
- Parameters:
x
- valueofs
- offsetlen
- length
public void write_longlong(long x)
Writes the long (CORBA long long) value, 8 bytes, high byte first.
- Specified by:
- write_longlong in interface DataOutputStream
- Overrides:
- write_longlong in interface OutputStream
- Parameters:
x
- the value to write.
public void write_longlong_array(long[] x, int ofs, int len)
Writes the array of longs (CORBA long longs) values.
- Specified by:
- write_longlong_array in interface DataOutputStream
- Overrides:
- write_longlong_array in interface OutputStream
- Parameters:
x
- valueofs
- offsetlen
- length
public void write_octet(byte x)
Writes this byte.
- Specified by:
- write_octet in interface DataOutputStream
- Overrides:
- write_octet in interface OutputStream
- Parameters:
x
-
public void write_octet_array(byte[] x, int ofs, int len)
Writes the array of bytes (CORBA octets) values.
- Specified by:
- write_octet_array in interface DataOutputStream
- Overrides:
- write_octet_array in interface OutputStream
- Parameters:
x
- valueofs
- offsetlen
- length
public void write_sequence(byte[] buf)
Writes first the size of array, and then the byte array using theOutputStream.write(byte[])
. The sequence being written is preceeded by the int, representing the array length.
public void write_sequence(BufferedCdrOutput from)
Writes the contents of the provided stream. The sequence being written is preceeded by the int, representing the stream buffer length (the number of bytes being subsequently written).
public void write_short(short x)
Writes the two byte integer (short), high byte first.
- Specified by:
- write_short in interface DataOutputStream
- Overrides:
- write_short in interface OutputStream
- Parameters:
x
- the integer to write.
public void write_short_array(short[] x, int ofs, int len)
Writes the array of short (two byte integer) values.
- Specified by:
- write_short_array in interface DataOutputStream
- Overrides:
- write_short_array in interface OutputStream
- Parameters:
x
- valueofs
- offsetlen
- length
public void write_string(String x)
Writes the string. This implementation first calls String.getBytes() and then writes the length of the returned array (as CORBA ulong) and the returned array itself. The encoding information, if previously set, is taken into consideration.
- Specified by:
- write_string in interface DataOutputStream
- Overrides:
- write_string in interface OutputStream
- Parameters:
x
- the string to write.
public void write_ulong(int x)
Writes the CORBA unsigned long in the same way as CORBA long.
- Specified by:
- write_ulong in interface DataOutputStream
- Overrides:
- write_ulong in interface OutputStream
public void write_ulong_array(int[] x, int ofs, int len)
Writes the array of CORBA unsigned longs in the same way as array of ordinary longs.
- Specified by:
- write_ulong_array in interface DataOutputStream
- Overrides:
- write_ulong_array in interface OutputStream
public void write_ulonglong(long x)
Write the unsigned long long in the same way as an ordinary long long.
- Specified by:
- write_ulonglong in interface DataOutputStream
- Overrides:
- write_ulonglong in interface OutputStream
- Parameters:
x
- a value to write.
public void write_ulonglong_array(long[] x, int ofs, int len)
Write the array of unsingel long longs in the same way an an array of the ordinary long longs.
- Specified by:
- write_ulonglong_array in interface DataOutputStream
- Overrides:
- write_ulonglong_array in interface OutputStream
public void write_ushort(short x)
Write the unsigned short in the same way as an ordinary short.
- Specified by:
- write_ushort in interface DataOutputStream
- Overrides:
- write_ushort in interface OutputStream
public void write_ushort_array(short[] x, int ofs, int len)
Write an array of unsigned short integersin the same way as an array of ordinary short integers.
- Specified by:
- write_ushort_array in interface DataOutputStream
- Overrides:
- write_ushort_array in interface OutputStream
public void write_wchar(char x)
Writes the character as two byte short integer (Unicode value), high byte first. Writes in Big Endian, but never writes the endian indicator. The character is always written using the native UTF-16BE charset because its size under arbitrary encoding is not evident.
- Specified by:
- write_wchar in interface DataOutputStream
- Overrides:
- write_wchar in interface OutputStream
public void write_wchar_array(char[] chars, int offset, int length)
Write the array of wide chars.
- Specified by:
- write_wchar_array in interface DataOutputStream
- Overrides:
- write_wchar_array in interface OutputStream
- Parameters:
chars
- the array of wide charsoffset
- offsetlength
- length The char array is always written using the native UTF-16BE charset because the character size under arbitrary encoding is not evident.
public void write_wstring(String x)
Writes the length of the string in bytes (not characters) and then all characters as two byte unicode chars. Adds the Big Endian indicator, 0xFFFE, at the beginning and null wide char at the end.
- Specified by:
- write_wstring in interface DataOutputStream
- Overrides:
- write_wstring in interface OutputStream
- Parameters:
x
- the string to write.