summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2005-04-29 16:47:40 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2005-04-29 16:47:40 +0000
commitddeb4663884c7c06a0be469b7cdbe5d2a406f326 (patch)
treefb511e29e1ef03634c91e2df531027d7b9c9751d
parenteaf09eb247ee1d55001c27f086721f0110e8c2ee (diff)
downloadclasspath-ddeb4663884c7c06a0be469b7cdbe5d2a406f326.tar.gz
The current version of helpers instantiates the additional holder object
each time when the helper is used to read or write the data. The suggested path removes these instantiations. 2005-04-28 Audrius Meskauskas <AudriusA@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.
-rw-r--r--ChangeLog19
-rw-r--r--org/omg/CORBA/AnySeqHelper.java20
-rw-r--r--org/omg/CORBA/BooleanSeqHelper.java16
-rw-r--r--org/omg/CORBA/CharSeqHelper.java16
-rw-r--r--org/omg/CORBA/DoubleSeqHelper.java16
-rw-r--r--org/omg/CORBA/FloatSeqHelper.java16
-rw-r--r--org/omg/CORBA/LongLongSeqHelper.java18
-rw-r--r--org/omg/CORBA/LongSeqHelper.java16
-rw-r--r--org/omg/CORBA/OctetSeqHelper.java16
-rw-r--r--org/omg/CORBA/ShortSeqHelper.java16
-rw-r--r--org/omg/CORBA/StringSeqHelper.java19
-rw-r--r--org/omg/CORBA/ULongLongSeqHelper.java18
-rw-r--r--org/omg/CORBA/ULongSeqHelper.java16
-rw-r--r--org/omg/CORBA/UShortSeqHelper.java16
-rw-r--r--org/omg/CORBA/WCharSeqHelper.java16
-rw-r--r--org/omg/CORBA/WStringSeqHelper.java23
16 files changed, 113 insertions, 164 deletions
diff --git a/ChangeLog b/ChangeLog
index 29ee34345..ccef0fc6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2005-04-29 Audrius Meskauskas <AudriusA@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-04-29 Sven de Marothy <sven@physto.se>
Mark Wielaard <mark@klomp.org>
diff --git a/org/omg/CORBA/AnySeqHelper.java b/org/omg/CORBA/AnySeqHelper.java
index 8a8fdf1bf..2165b7ab3 100644
--- a/org/omg/CORBA/AnySeqHelper.java
+++ b/org/omg/CORBA/AnySeqHelper.java
@@ -114,9 +114,12 @@ public abstract class AnySeqHelper
*/
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 @@ public abstract class AnySeqHelper
/**
* 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 ]);
+ }
}
}
diff --git a/org/omg/CORBA/BooleanSeqHelper.java b/org/omg/CORBA/BooleanSeqHelper.java
index cfead72b8..0df1fbcb0 100644
--- a/org/omg/CORBA/BooleanSeqHelper.java
+++ b/org/omg/CORBA/BooleanSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class BooleanSeqHelper
/**
* 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 @@ public abstract class BooleanSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/CharSeqHelper.java b/org/omg/CORBA/CharSeqHelper.java
index 3d9872353..c1af52a28 100644
--- a/org/omg/CORBA/CharSeqHelper.java
+++ b/org/omg/CORBA/CharSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class CharSeqHelper
/**
* 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 @@ public abstract class CharSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/DoubleSeqHelper.java b/org/omg/CORBA/DoubleSeqHelper.java
index 1828ca518..160c40fd3 100644
--- a/org/omg/CORBA/DoubleSeqHelper.java
+++ b/org/omg/CORBA/DoubleSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class DoubleSeqHelper
/**
* 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 @@ public abstract class DoubleSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/FloatSeqHelper.java b/org/omg/CORBA/FloatSeqHelper.java
index e34980569..98721dc13 100644
--- a/org/omg/CORBA/FloatSeqHelper.java
+++ b/org/omg/CORBA/FloatSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class FloatSeqHelper
/**
* 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 @@ public abstract class FloatSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/LongLongSeqHelper.java b/org/omg/CORBA/LongLongSeqHelper.java
index 37e3cb918..31cad8d80 100644
--- a/org/omg/CORBA/LongLongSeqHelper.java
+++ b/org/omg/CORBA/LongLongSeqHelper.java
@@ -105,19 +105,16 @@ public abstract class LongLongSeqHelper
}
/**
- * 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 @@ public abstract class LongLongSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/LongSeqHelper.java b/org/omg/CORBA/LongSeqHelper.java
index 49ff87774..ff33e56a7 100644
--- a/org/omg/CORBA/LongSeqHelper.java
+++ b/org/omg/CORBA/LongSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class LongSeqHelper
/**
* 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 @@ public abstract class LongSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/OctetSeqHelper.java b/org/omg/CORBA/OctetSeqHelper.java
index dabf8c829..220899153 100644
--- a/org/omg/CORBA/OctetSeqHelper.java
+++ b/org/omg/CORBA/OctetSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class OctetSeqHelper
/**
* 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 @@ public abstract class OctetSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/ShortSeqHelper.java b/org/omg/CORBA/ShortSeqHelper.java
index cd4198a7b..de42b6926 100644
--- a/org/omg/CORBA/ShortSeqHelper.java
+++ b/org/omg/CORBA/ShortSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class ShortSeqHelper
/**
* 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 @@ public abstract class ShortSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/StringSeqHelper.java b/org/omg/CORBA/StringSeqHelper.java
index 0a5a305fc..0b6365a3b 100644
--- a/org/omg/CORBA/StringSeqHelper.java
+++ b/org/omg/CORBA/StringSeqHelper.java
@@ -105,18 +105,16 @@ public abstract class StringSeqHelper
/**
* 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 @@ public abstract class StringSeqHelper
/**
* 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 ]);
}
}
diff --git a/org/omg/CORBA/ULongLongSeqHelper.java b/org/omg/CORBA/ULongLongSeqHelper.java
index f6d2177b1..04a9b015f 100644
--- a/org/omg/CORBA/ULongLongSeqHelper.java
+++ b/org/omg/CORBA/ULongLongSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class ULongLongSeqHelper
/**
* 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 abstract class ULongLongSeqHelper
*/
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);
}
}
diff --git a/org/omg/CORBA/ULongSeqHelper.java b/org/omg/CORBA/ULongSeqHelper.java
index a0db40216..7b94e80b3 100644
--- a/org/omg/CORBA/ULongSeqHelper.java
+++ b/org/omg/CORBA/ULongSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class ULongSeqHelper
/**
* 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 @@ public abstract class ULongSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/UShortSeqHelper.java b/org/omg/CORBA/UShortSeqHelper.java
index d899a06ba..292c25457 100644
--- a/org/omg/CORBA/UShortSeqHelper.java
+++ b/org/omg/CORBA/UShortSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class UShortSeqHelper
/**
* 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 @@ public abstract class UShortSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/WCharSeqHelper.java b/org/omg/CORBA/WCharSeqHelper.java
index 61958bc51..3b824459b 100644
--- a/org/omg/CORBA/WCharSeqHelper.java
+++ b/org/omg/CORBA/WCharSeqHelper.java
@@ -106,18 +106,15 @@ public abstract class WCharSeqHelper
/**
* 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 @@ public abstract class WCharSeqHelper
/**
* 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);
}
}
diff --git a/org/omg/CORBA/WStringSeqHelper.java b/org/omg/CORBA/WStringSeqHelper.java
index 62f22473c..425a7397f 100644
--- a/org/omg/CORBA/WStringSeqHelper.java
+++ b/org/omg/CORBA/WStringSeqHelper.java
@@ -105,18 +105,18 @@ public abstract class WStringSeqHelper
/**
* 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 @@ public abstract class WStringSeqHelper
/**
* 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 ]);
+ }
}
}