summaryrefslogtreecommitdiff
path: root/org
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2005-10-27 13:56:51 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2005-10-27 13:56:51 +0000
commit2459e73cdf14edb4a84a987942263ab80dc6efd6 (patch)
tree4608dea84472451e29707064c2e342701d2edefd /org
parent884c7f5a5d6931ec4156e903cfcfb5f7e8961e24 (diff)
downloadclasspath-2459e73cdf14edb4a84a987942263ab80dc6efd6.tar.gz
2005-10-27 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* org/omg/PortableInterceptor/ObjectIdHelper.java: Assuming ObjectId as alias of byte[], not alias of String.
Diffstat (limited to 'org')
-rw-r--r--org/omg/PortableInterceptor/ObjectIdHelper.java40
1 files changed, 21 insertions, 19 deletions
diff --git a/org/omg/PortableInterceptor/ObjectIdHelper.java b/org/omg/PortableInterceptor/ObjectIdHelper.java
index fb0ab182f..4c8351773 100644
--- a/org/omg/PortableInterceptor/ObjectIdHelper.java
+++ b/org/omg/PortableInterceptor/ObjectIdHelper.java
@@ -42,14 +42,15 @@ import gnu.CORBA.Restricted_ORB;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
+import org.omg.CORBA.OctetSeqHelper;
+import org.omg.CORBA.OctetSeqHolder;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
/**
- * The Object Id is defined in OMG specification just as a narrow (not wide)
- * string. As such, the Object Id needs no helper, but one is included in
- * the API anyway.
+ * The Object Id of this package is defined in OMG specification as a byte array.
+ * As such, the Object Id needs no helper, but one is included in the API anyway.
*
* @since 1.5
*
@@ -58,33 +59,34 @@ import org.omg.CORBA.portable.OutputStream;
public abstract class ObjectIdHelper
{
/**
- * Insert the Object Id into Any (uses {@link Any.insert_string}).
+ * Insert the Object Id into Any.
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
- public static void insert(Any a, String that)
+ public static void insert(Any a, byte[] that)
{
- a.insert_string(that);
+ a.insert_Streamable(new OctetSeqHolder(that));
+ a.type(type());
}
/**
- * Extract the Object Id from Any ((uses {@link Any.extract_string}).
- *
+ * Extract the Object Id from Any.
+ *
* @param a the Any to extract from.
*/
- public static String extract(Any a)
+ public static byte[] extract(Any a)
{
- return a.extract_string();
+ return ((OctetSeqHolder) a.extract_Streamable()).value;
}
/**
- * Return an alias typecode.
+ * Return an alias typecode (an alias of the octet sequence).
*/
public static TypeCode type()
{
ORB orb = Restricted_ORB.Singleton;
- return orb.create_alias_tc(id(), "ObjectId", orb.create_string_tc(0));
+ return orb.create_alias_tc(id(), "ObjectId", OctetSeqHelper.type());
}
/**
@@ -97,23 +99,23 @@ public abstract class ObjectIdHelper
}
/**
- * Calls {@link InputStream#read_string()}.
+ * Read the Object Id as a byte array.
*
* @param input the stream to read from.
*/
- public static String read(InputStream input)
+ public static byte[] read(InputStream input)
{
- return input.read_string();
+ return OctetSeqHelper.read(input);
}
/**
- * Calls {@link OutputStream#write_string()}.
+ * Write the Object Id as a byte array.
*
* @param output the stream to write into.
- * @param value the string (Object Id) value to write.
+ * @param value the Object Id value to write.
*/
- public static void write(OutputStream output, String value)
+ public static void write(OutputStream output, byte[] value)
{
- output.write_string(value);
+ OctetSeqHelper.write(output, value);
}
} \ No newline at end of file