private static String iorToString(IOR ior) { try { CDROutputStream out = new CDROutputStream(); // endianness = false, big-endian out.write_boolean(false); org.omg.IOP.IORHelper.write(out, ior); byte bytes[] = out.getBufferCopy(); StringBuffer sb = new StringBuffer("IOR:"); for (int j=0; j<bytes.length; j++) { int b = bytes[j]; if(b<0) b+= 256; int n1 = (0xff & b) / 16; int n2 = (0xff & b) % 16; int c1 = (n1 < 10) ? ('0' + n1) : ('a' + (n1 - 10)); int c2 = (n2 < 10) ? ('0' + n2) : ('a' + (n2 - 10)); sb.append((char)c1); sb.append((char)c2); } return sb.toString(); } catch (Exception e) { return null; } }
private static String iorToString(IOR ior) { try { CDROutputStream out = new CDROutputStream(); // endianness = false, big-endian out.write_boolean(false); org.omg.IOP.IORHelper.write(out, ior); byte bytes[] = out.getBufferCopy(); StringBuffer sb = new StringBuffer("IOR:"); for (int j=0; j<bytes.length; j++) { int b = bytes[j]; if(b<0) b+= 256; int n1 = (0xff & b) / 16; int n2 = (0xff & b) % 16; int c1 = (n1 < 10) ? ('0' + n1) : ('a' + (n1 - 10)); int c2 = (n2 < 10) ? ('0' + n2) : ('a' + (n2 - 10)); sb.append((char)c1); sb.append((char)c2); } return sb.toString(); } catch (Exception e) { return null; } }
private boolean compareComplexValue(org.omg.CORBA.Any other) { final CDROutputStream thisStream; if (value instanceof CDROutputStream) { thisStream = (CDROutputStream)value; } else { thisStream = new CDROutputStream(orb); write_value(thisStream); } final CDROutputStream otherStream; if (other instanceof Any && ((Any) other).value instanceof CDROutputStream) { otherStream = (CDROutputStream) ((Any) other).value; } else { otherStream = new CDROutputStream(orb); other.write_value( otherStream ); } return Arrays.equals( thisStream.getBufferCopy(), otherStream.getBufferCopy()); } }
public org.omg.CORBA.portable.InputStream create_input_stream() { if(value instanceof org.jacorb.orb.CDROutputStream) { return new org.jacorb.orb.CDRInputStream( orb, ((CDROutputStream)value).getBufferCopy()); } final org.jacorb.orb.CDROutputStream out = new org.jacorb.orb.CDROutputStream(orb); try { write_value(out); return new org.jacorb.orb.CDRInputStream(orb, out.getBufferCopy()); } finally { out.close(); } }
public ExceptionHolderImpl(ORB orb, org.omg.CORBA.SystemException exception) { this(orb); is_system_exception = true; byte_order = false; final CDROutputStream out = new CDROutputStream(orb); try { SystemExceptionHelper.write(out, exception); marshaled_exception = out.getBufferCopy(); } finally { out.close(); } }
/** * Marshals this object into a new buffer and returns that buffer. */ public byte[] marshal() { final CDROutputStream out = new CDROutputStream( orb ); try { out.write_value( this, "IDL:omg.org/Messaging/ExceptionHolder:1.0" ); return out.getBufferCopy(); } finally { out.close(); } } }
public byte [] toCDR () { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); this.write(out); return out.getBufferCopy(); } finally { out.close(); } }
public byte[] encode(Any data) throws InvalidTypeForEncoding { final CDROutputStream out = new CDROutputStream(orb); try { out.beginEncapsulatedArray(); out.write_any(data); // do not end encapsulation since it will patch the // array with a size! return out.getBufferCopy(); } finally { out.close(); } }
public byte[] encode_value(Any data) throws InvalidTypeForEncoding { final CDROutputStream out = new CDROutputStream(orb); try { out.beginEncapsulatedArray(); data.write_value(out); // do not end encapsulation since it will patch the // array with a size! return out.getBufferCopy(); } finally { out.close(); } } }
/** * Returns a CDR encapsulation of the given UtcT. */ public static byte[] toCDR(UtcT time) { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); UtcTHelper.write(out, time); return out.getBufferCopy(); } finally { out.close(); } }
/** * The group object key, or the tagGroup as a byte array. * * @return tagGroup as a byte array. */ @Override public byte[] get_object_key () { if (objectKey == null) { CDROutputStream out = new CDROutputStream (); out.beginEncapsulatedArray (); TagGroupTaggedComponentHelper.write (out, tagGroup); objectKey = out.getBufferCopy (); out.close(); } return objectKey; }
private TaggedProfile createMultipleComponentsProfile (TaggedComponentList components) { CDROutputStream out = new CDROutputStream(this); out.beginEncapsulatedArray(); MultipleComponentProfileHelper.write(out, components.asArray()); return new TaggedProfile ( TAG_MULTIPLE_COMPONENTS.value, out.getBufferCopy() ); }
/** * Creates an ORB_TYPE_ID tagged component for JacORB. */ private TaggedComponent create_ORB_TYPE_ID() { final CDROutputStream out = new CDROutputStream( this ); try { out.beginEncapsulatedArray(); out.write_long( ORBConstants.JACORB_ORB_ID ); return new TaggedComponent ( TAG_ORB_TYPE.value, out.getBufferCopy() ); } finally { out.close(); } }
/** * Creates a ServiceContext for transmitting an exception detail message, * as per section 1.15.2 of the Java Mapping. */ public static ServiceContext createExceptionDetailMessage (String message) { final CDROutputStream out = new CDROutputStream(); try { out.beginEncapsulatedArray(); out.write_wstring(message); return new ServiceContext(org.omg.IOP.ExceptionDetailMessage.value, out.getBufferCopy()); } finally { out.close(); } }
/** * Encode this profile as a TaggedProfile (marshaled). * * @param taggedProfile a tagged profile holder. * @param taggedComponentSeq unused. */ @Override public void marshal (TaggedProfileHolder taggedProfile, TaggedComponentSeqHolder taggedComponentSeq) { if (data == null) { CDROutputStream out = new CDROutputStream (); out.beginEncapsulatedArray (); UIPMC_ProfileBodyHelper.write (out, uipmc); data = out.getBufferCopy (); out.close (); } taggedProfile.value = new TaggedProfile (TAG_UIPMC.value, data); }
private ServiceContext createInvocationPolicies() { final CDROutputStream out = new CDROutputStream( orb ); try { out.beginEncapsulatedArray(); PolicyValueSeqHelper.write(out, getTimingPolicyValues()); return new ServiceContext (INVOCATION_POLICIES.value, out.getBufferCopy()); } finally { out.close(); } } }
private static byte[] getEncapsulatedUIPMCProfile (org.jacorb.orb.ORB orb, ClientConnection connection, UIPMC_ProfileBody upb) { CDROutputStream out = new CDROutputStream (orb); out.beginEncapsulatedArray (); if (connection != null) { UIPMC_ProfileBodyHelper.write (out, ((MIOPProfile)connection.getRegisteredProfile ()).getUIPMCProfile ()); } else { UIPMC_ProfileBodyHelper.write (out, upb); } byte []result = out.getBufferCopy (); out.close(); return result; } }
private ServiceContext createCodesetContext( CodeSet tcs, CodeSet tcsw ) { // encapsulate context final CDROutputStream os = new CDROutputStream( orb ); try { os.beginEncapsulatedArray(); CodeSetContextHelper.write( os, new CodeSetContext( tcs.getId(), tcsw.getId() )); return new ServiceContext( TAG_CODE_SETS.value, os.getBufferCopy() ); } finally { os.close(); } }
public CodeSetInfoInterceptor(ORB orb) throws ConfigurationException { super(); configure(orb.getConfiguration()); // encapsulate it into TaggedComponent final CDROutputStream out = new CDROutputStream( orb ); try { out.beginEncapsulatedArray(); CodeSetComponentInfoHelper.write( out, orb.getLocalCodeSetComponentInfo() ); tagc = new TaggedComponent(TAG_CODE_SETS.value, out.getBufferCopy()); } finally { out.close(); } }
public org.omg.CORBA.Any to_any() { checkDestroyed (); final CDROutputStream out = new CDROutputStream(orb); try { out.write_long( enumValue ); org.omg.CORBA.Any out_any = orb.create_any(); out_any.type(type()); final CDRInputStream in = new CDRInputStream(orb, out.getBufferCopy()); try { out_any.read_value( in, type()); return out_any; } finally { in.close(); } } finally { out.close(); } }