public Any extractAny(TypeCode memberType, ORB orb) { Any returnValue = orb.create_any(); OutputStream out = returnValue.create_output_stream(); TypeCodeImpl.convertToNative(orb, memberType).copy(stream, out); returnValue.read_value(out.create_input_stream(), memberType); return returnValue; }
public Any extractAny(TypeCode memberType, ORB orb) { Any returnValue = orb.create_any(); OutputStream out = returnValue.create_output_stream(); TypeCodeImpl.convertToNative(orb, memberType).copy(stream, out); returnValue.read_value(out.create_input_stream(), memberType); return returnValue; }
static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) { Any returnValue = orb.create_any(); OutputStream out = returnValue.create_output_stream(); TypeCodeImpl.convertToNative(orb, memberType).copy(input, out); returnValue.read_value(out.create_input_stream(), memberType); return returnValue; }
static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) { Any returnValue = orb.create_any(); OutputStream out = returnValue.create_output_stream(); TypeCodeImpl.convertToNative(orb, memberType).copy(input, out); returnValue.read_value(out.create_input_stream(), memberType); return returnValue; }
public Any read_any() { Any any = orb.create_any(); TypeCodeImpl tc = new TypeCodeImpl(orb); // read off the typecode // REVISIT We could avoid this try-catch if we could peek the typecode kind off this stream and see if it is a // tk_value. Looking at the code we know that for tk_value the Any.read_value() below ignores the tc argument // anyway (except for the kind field). But still we would need to make sure that the whole typecode, including // encapsulations, is read off. try { tc.read_value(parent); } catch (MARSHAL ex) { if (tc.kind().value() != TCKind._tk_value) throw ex; // We can be sure that the whole typecode encapsulation has been read off. dprintThrowable(ex); } // read off the value of the any any.read_value(parent, tc); return any; }
public Any read_any() { Any any = orb.create_any(); TypeCodeImpl tc = new TypeCodeImpl(orb); // read off the typecode // REVISIT We could avoid this try-catch if we could peek the typecode kind off this stream and see if it is a // tk_value. Looking at the code we know that for tk_value the Any.read_value() below ignores the tc argument // anyway (except for the kind field). But still we would need to make sure that the whole typecode, including // encapsulations, is read off. try { tc.read_value(parent); } catch (MARSHAL ex) { if (tc.kind().value() != TCKind._tk_value) throw ex; // We can be sure that the whole typecode encapsulation has been read off. dprintThrowable(ex); } // read off the value of the any any.read_value(parent, tc); return any; }
public Any read_any() { Any any = orb.create_any(); TypeCodeImpl tc = new TypeCodeImpl(orb); // read off the typecode // REVISIT We could avoid this try-catch if we could peek the typecode // kind off this stream and see if it is a tk_value. // Looking at the code we know that for tk_value the Any.read_value() // below ignores the tc argument anyway (except for the kind field). // But still we would need to make sure that the whole typecode, // including encapsulations, is read off. try { tc.read_value(parent); } catch (org.omg.CORBA.MARSHAL ex) { if (tc.kind().value() != org.omg.CORBA.TCKind._tk_value) { throw ex; } // We can be sure that the whole typecode encapsulation has been // read off. ex.printStackTrace(); } // read off the value of the any. any.read_value(parent, tc); return any; }
public Any read_any() { Any any = orb.create_any(); TypeCodeImpl tc = new TypeCodeImpl(orb); // read off the typecode // REVISIT We could avoid this try-catch if we could peek the typecode // kind off this stream and see if it is a tk_value. // Looking at the code we know that for tk_value the Any.read_value() // below ignores the tc argument anyway (except for the kind field). // But still we would need to make sure that the whole typecode, // including encapsulations, is read off. try { tc.read_value(parent); } catch (org.omg.CORBA.MARSHAL ex) { if (tc.kind().value() != org.omg.CORBA.TCKind._tk_value) { throw ex; } // We can be sure that the whole typecode encapsulation has been // read off. ex.printStackTrace(); } // read off the value of the any. any.read_value(parent, tc); return any; }
Any myDiscriminator = orb.create_any(); Any otherDiscriminator = orb.create_any(); myDiscriminator.read_value(myStream, realType.discriminator_type()); otherDiscriminator.read_value(otherStream, realType.discriminator_type());
Any myDiscriminator = orb.create_any(); Any otherDiscriminator = orb.create_any(); myDiscriminator.read_value(myStream, realType.discriminator_type()); otherDiscriminator.read_value(otherStream, realType.discriminator_type());