[kaffe] CVS kaffe (robilad): resynced with gnu classpath: corba fixes
Kaffe CVS
cvs-commits at kaffe.org
Sun May 15 06:01:22 PDT 2005
PatchSet 6497
Date: 2005/05/15 12:57:10
Author: robilad
Branch: HEAD
Tag: (none)
Log:
resynced with gnu classpath: corba fixes
Members:
ChangeLog:1.4022->1.4023
libraries/javalib/org/omg/CORBA/AnySeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/CharSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/FloatSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/LongSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/OctetSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/ShortSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/StringSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/ULongSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/UShortSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/WCharSeqHelper.java:1.1->1.2
libraries/javalib/org/omg/CORBA/WStringSeqHelper.java:1.1->1.2
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4022 kaffe/ChangeLog:1.4023
--- kaffe/ChangeLog:1.4022 Sun May 15 12:46:14 2005
+++ kaffe/ChangeLog Sun May 15 12:57:10 2005
@@ -2,6 +2,29 @@
Resynced with GNU Classpath.
+ 2005-04-29 Audrius Meskauskas <AudriusA at bluewin.ch>
+
+ * org/omg/CORBA/WStringSeqHelper.java,
+ org/omg/CORBA/AnySeqHelper.java,
+ org/omg/CORBA/BooleanSeqHelper.java,
+ org/omg/CORBA/CharSeqHelper.java,
+ org/omg/CORBA/DoubleSeqHelper.java,
+ org/omg/CORBA/FloatSeqHelper.java,
+ org/omg/CORBA/LongLongSeqHelper.java,
+ org/omg/CORBA/LongSeqHelper.java,
+ org/omg/CORBA/OctetSeqHelper.java,
+ org/omg/CORBA/ShortSeqHelper.java,
+ org/omg/CORBA/StringSeqHelper.java,
+ org/omg/CORBA/ULongLongSeqHelper.java,
+ org/omg/CORBA/ULongSeqHelper.java,
+ org/omg/CORBA/UShortSeqHelper.java,
+ org/omg/CORBA/WCharSeqHelper.java:
+ Removing redundant object instantiation.
+
+2005-05-15 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
2005-04-29 Sven de Marothy <sven at physto.se>
Mark Wielaard <mark at klomp.org>
Index: kaffe/libraries/javalib/org/omg/CORBA/AnySeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/AnySeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/AnySeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/AnySeqHelper.java:1.1 Mon Mar 21 19:16:21 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/AnySeqHelper.java Sun May 15 12:57:14 2005
@@ -114,9 +114,12 @@
*/
public static Any[] read(InputStream input)
{
- AnySeqHolder h = new AnySeqHolder();
- h._read(input);
- return h.value;
+ Any[] value = new Any[ input.read_long() ];
+ for (int i = 0; i < value.length; i++)
+ {
+ value [ i ] = input.read_any();
+ }
+ return value;
}
/**
@@ -132,16 +135,17 @@
/**
* Writes the array of {@link Any}'s into the given stream.
- * This implementation first creates an instance of
- * {@link AnySeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, Any[] value)
{
- AnySeqHolder h = new AnySeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+
+ for (int i = 0; i < value.length; i++)
+ {
+ output.write_any(value [ i ]);
+ }
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/BooleanSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>boolean[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link BooleanSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static boolean[] read(InputStream input)
{
- BooleanSeqHolder h = new BooleanSeqHolder();
- h._read(input);
- return h.value;
+ boolean [] value = new boolean[ input.read_long() ];
+ input.read_boolean_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>boolean[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link BooleanSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, boolean[] value)
{
- BooleanSeqHolder h = new BooleanSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_boolean_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/CharSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/CharSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/CharSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/CharSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/CharSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>char[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link CharSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static char[] read(InputStream input)
{
- CharSeqHolder h = new CharSeqHolder();
- h._read(input);
- return h.value;
+ char [] value = new char[ input.read_long() ];
+ input.read_char_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>char[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link CharSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, char[] value)
{
- CharSeqHolder h = new CharSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_char_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/DoubleSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>double[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link DoubleSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static double[] read(InputStream input)
{
- DoubleSeqHolder h = new DoubleSeqHolder();
- h._read(input);
- return h.value;
+ double[] value = new double[ input.read_long() ];
+ input.read_double_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>double[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link DoubleSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, double[] value)
{
- DoubleSeqHolder h = new DoubleSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_double_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/FloatSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/FloatSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/FloatSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/FloatSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/FloatSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>float[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link FloatSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static float[] read(InputStream input)
{
- FloatSeqHolder h = new FloatSeqHolder();
- h._read(input);
- return h.value;
+ float[] value = new float[ input.read_long() ];
+ input.read_float_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>float[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link FloatSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, float[] value)
{
- FloatSeqHolder h = new FloatSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_float_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/LongLongSeqHelper.java Sun May 15 12:57:14 2005
@@ -105,19 +105,16 @@
}
/**
- * Reads the <code>long[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link LongLongSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
+ * Reads the <code>long long[]</code> from the CORBA input stream.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static long[] read(InputStream input)
{
- LongLongSeqHolder h = new LongLongSeqHolder();
- h._read(input);
- return h.value;
+ long[] value = new long[ input.read_long() ];
+ input.read_longlong_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>long[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link LongLongSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, long[] value)
{
- LongLongSeqHolder h = new LongLongSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_longlong_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/LongSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/LongSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/LongSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/LongSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/LongSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>int[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link LongSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static int[] read(InputStream input)
{
- LongSeqHolder h = new LongSeqHolder();
- h._read(input);
- return h.value;
+ int[] value = new int[ input.read_long() ];
+ input.read_long_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>int[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link LongSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, int[] value)
{
- LongSeqHolder h = new LongSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_long_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/OctetSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/OctetSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/OctetSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/OctetSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/OctetSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>byte[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link OctetSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static byte[] read(InputStream input)
{
- OctetSeqHolder h = new OctetSeqHolder();
- h._read(input);
- return h.value;
+ byte[] value = new byte[ input.read_long() ];
+ input.read_octet_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>byte[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link OctetSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, byte[] value)
{
- OctetSeqHolder h = new OctetSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_octet_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/ShortSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/ShortSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/ShortSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/ShortSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/ShortSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>short[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link ShortSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static short[] read(InputStream input)
{
- ShortSeqHolder h = new ShortSeqHolder();
- h._read(input);
- return h.value;
+ short[] value = new short[ input.read_long() ];
+ input.read_short_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>short[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link ShortSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, short[] value)
{
- ShortSeqHolder h = new ShortSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_short_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/StringSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/StringSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/StringSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/StringSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/StringSeqHelper.java Sun May 15 12:57:14 2005
@@ -105,18 +105,16 @@
/**
* Reads the <code>String[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link StringSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static String[] read(InputStream input)
{
- StringSeqHolder h = new StringSeqHolder();
- h._read(input);
- return h.value;
+ String[] value = new String[ input.read_long() ];
+ for (int i = 0; i < value.length; i++)
+ value [ i ] = input.read_wstring();
+ return value;
}
/**
@@ -132,16 +130,15 @@
/**
* Writes the <code>String[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link StringSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, String[] value)
{
- StringSeqHolder h = new StringSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+
+ for (int i = 0; i < value.length; i++)
+ output.write_wstring(value [ i ]);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/ULongLongSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>long[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link ULongLongSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static long[] read(InputStream input)
{
- ULongLongSeqHolder h = new ULongLongSeqHolder();
- h._read(input);
- return h.value;
+ long[] value = new long[ input.read_long() ];
+ input.read_ulonglong_array(value, 0, value.length);
+ return value;
}
/**
@@ -128,21 +125,18 @@
*/
public static TypeCode type()
{
- return new primitiveArrayTypeCode(TCKind.tk_long);
+ return new primitiveArrayTypeCode(TCKind.tk_ulong);
}
/**
* Writes the <code>long[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link ULongLongSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, long[] value)
{
- ULongLongSeqHolder h = new ULongLongSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_ulonglong_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/ULongSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/ULongSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/ULongSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/ULongSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/ULongSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>int[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link ULongSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static int[] read(InputStream input)
{
- ULongSeqHolder h = new ULongSeqHolder();
- h._read(input);
- return h.value;
+ int[] value = new int[ input.read_long() ];
+ input.read_ulong_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>int[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link ULongSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, int[] value)
{
- ULongSeqHolder h = new ULongSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_ulong_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/UShortSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/UShortSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/UShortSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/UShortSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/UShortSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>short[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link UShortSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static short[] read(InputStream input)
{
- UShortSeqHolder h = new UShortSeqHolder();
- h._read(input);
- return h.value;
+ short[] value = new short[ input.read_long() ];
+ input.read_ushort_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>short[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link UShortSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, short[] value)
{
- UShortSeqHolder h = new UShortSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_ushort_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/WCharSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/WCharSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/WCharSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/WCharSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/WCharSeqHelper.java Sun May 15 12:57:14 2005
@@ -106,18 +106,15 @@
/**
* Reads the <code>char[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link WCharSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static char[] read(InputStream input)
{
- WCharSeqHolder h = new WCharSeqHolder();
- h._read(input);
- return h.value;
+ char[] value = new char[ input.read_long() ];
+ input.read_wchar_array(value, 0, value.length);
+ return value;
}
/**
@@ -133,16 +130,13 @@
/**
* Writes the <code>char[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link WCharSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, char[] value)
{
- WCharSeqHolder h = new WCharSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+ output.write_wchar_array(value, 0, value.length);
}
}
Index: kaffe/libraries/javalib/org/omg/CORBA/WStringSeqHelper.java
diff -u kaffe/libraries/javalib/org/omg/CORBA/WStringSeqHelper.java:1.1 kaffe/libraries/javalib/org/omg/CORBA/WStringSeqHelper.java:1.2
--- kaffe/libraries/javalib/org/omg/CORBA/WStringSeqHelper.java:1.1 Tue Mar 15 01:36:13 2005
+++ kaffe/libraries/javalib/org/omg/CORBA/WStringSeqHelper.java Sun May 15 12:57:14 2005
@@ -105,18 +105,18 @@
/**
* Reads the <code>String[]</code> from the CORBA input stream.
- * This implementation first creates an instance of
- * {@link WStringSeqHolder} and then delegates functionality
- * to its <code>_read()</code> method.
*
* @param input the CORBA (not java.io) stream to read from.
* @return the value from the stream.
*/
public static String[] read(InputStream input)
{
- WStringSeqHolder h = new WStringSeqHolder();
- h._read(input);
- return h.value;
+ String[] value = new String[ input.read_long() ];
+ for (int i = 0; i < value.length; i++)
+ {
+ value [ i ] = input.read_wstring();
+ }
+ return value;
}
/**
@@ -132,16 +132,17 @@
/**
* Writes the <code>String[]</code> into the given stream.
- * This implementation first creates an instance of
- * {@link WStringSeqHolder} and then delegates functionality
- * to its <code>_write()</code> method.
*
* @param output the CORBA (not java.io) output stream to write.
* @param value the value that must be written.
*/
public static void write(OutputStream output, String[] value)
{
- WStringSeqHolder h = new WStringSeqHolder(value);
- h._write(output);
+ output.write_long(value.length);
+
+ for (int i = 0; i < value.length; i++)
+ {
+ output.write_wstring(value [ i ]);
+ }
}
}
More information about the kaffe
mailing list