Example #1
0
def cdr2data(cdr, classname):
	ostrm = EncapsOutputStream(orb, True)
	ostrm.write_octet_array(cdr, 0, len(cdr))
	istrm = ostrm.create_input_stream()
	holder = Class.forName("RTC."+classname+"Holder", True, Manager.getClassLoader())
	streamable = holder.newInstance()
	streamable._read(istrm)
	return streamable.value
Example #2
0
def cdr2data(cdr, classname):
    ostrm = EncapsOutputStream(orb, True)
    ostrm.write_octet_array(cdr, 0, len(cdr))
    istrm = ostrm.create_input_stream()
    holder = Class.forName("RTC." + classname + "Holder", True,
                           Manager.getClassLoader())
    streamable = holder.newInstance()
    streamable._read(istrm)
    return streamable.value
Example #3
0
def data2cdr(data):
	holder = Class.forName(data.getClass().getCanonicalName()+"Holder",
			       True, data.getClass().getClassLoader())
	streamable = holder.newInstance()
	#field = holder.getField("value")
	#field.set(streamable, data)
	streamable.value = data;
	strm = EncapsOutputStream(orb, True)
	streamable._write(strm)
	return strm.toByteArray()
Example #4
0
def data2cdr(data):
    holder = Class.forName(data.getClass().getCanonicalName() + "Holder", True,
                           data.getClass().getClassLoader())
    streamable = holder.newInstance()
    #field = holder.getField("value")
    #field.set(streamable, data)
    streamable.value = data
    strm = EncapsOutputStream(orb, True)
    streamable._write(strm)
    return strm.toByteArray()