00001 package sctConf;
00002
00003
00011 abstract public class TrimArrayHelper
00012 {
00013 private static String _id = "IDL:sctConf/TrimArray:1.0";
00014
00015 public static void insert (org.omg.CORBA.Any a, byte[] that)
00016 {
00017 org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
00018 a.type (type ());
00019 write (out, that);
00020 a.read_value (out.create_input_stream (), type ());
00021 }
00022
00023 public static byte[] extract (org.omg.CORBA.Any a)
00024 {
00025 return read (a.create_input_stream ());
00026 }
00027
00028 private static org.omg.CORBA.TypeCode __typeCode = null;
00029 synchronized public static org.omg.CORBA.TypeCode type ()
00030 {
00031 if (__typeCode == null)
00032 {
00033 __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
00034 __typeCode = org.omg.CORBA.ORB.init ().create_array_tc (128, __typeCode );
00035 __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (sctConf.TrimArrayHelper.id (), "TrimArray", __typeCode);
00036 }
00037 return __typeCode;
00038 }
00039
00040 public static String id ()
00041 {
00042 return _id;
00043 }
00044
00045 public static byte[] read (org.omg.CORBA.portable.InputStream istream)
00046 {
00047 byte value[] = null;
00048 value = new byte[128];
00049 for (int _o0 = 0;_o0 < (128); ++_o0)
00050 {
00051 value[_o0] = istream.read_octet ();
00052 }
00053 return value;
00054 }
00055
00056 public static void write (org.omg.CORBA.portable.OutputStream ostream, byte[] value)
00057 {
00058 if (value.length != (128))
00059 throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
00060 for (int _i0 = 0;_i0 < (128); ++_i0)
00061 {
00062 ostream.write_octet (value[_i0]);
00063 }
00064 }
00065
00066 }