public String dec_ndr_string() throws NdrException { align(4); int i = index; String val = null; int len = Encdec.dec_uint32le(buf, i); i += 12; if (len != 0) { len--; int size = len * 2; try { if (size < 0 || size > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); val = new String(buf, i, size, "UnicodeLittle"); i += size + 2; } catch( UnsupportedEncodingException uee ) { } } advance(i - index); return val; } private int getDceReferent(Object obj) {
void encode(NetworkDataRepresentation ndr, int FLAGS) { //now for length //the length for STDOBJREF is fixed 40 bytes : 4,4,8,8,16. //Dual string array has to be computed, since that can vary. MEOW = 4., flag stdobjref = 4 // + 16 bytes of ipid int length = 40 + 4 + 4 + 16 + resolverAddr.getLength(); ndr.writeUnsignedLong(length); ndr.writeUnsignedLong(length); ndr.writeOctetArray(JIInterfacePointer.OBJREF_SIGNATURE,0,4); //std ref ndr.writeUnsignedLong(JIInterfacePointer.SORF_OXRES1); try { rpc.core.UUID ipid2 = new rpc.core.UUID(iid); if ((FLAGS & JIFlags.FLAG_REPRESENTATION_USE_IUNKNOWN_IID) == JIFlags.FLAG_REPRESENTATION_USE_IUNKNOWN_IID ) { ipid2 = new rpc.core.UUID(IJIComObject.IID); } else if ((FLAGS & JIFlags.FLAG_REPRESENTATION_USE_IDISPATCH_IID) == JIFlags.FLAG_REPRESENTATION_USE_IDISPATCH_IID) { ipid2 = new rpc.core.UUID(IJIDispatch.IID); } ipid2.encode(ndr,ndr.getBuffer()); } catch (NdrException e) { // TODO Auto-generated catch block e.printStackTrace(); } stdObjRef.encode(ndr); resolverAddr.encode(ndr); }
public String dec_ndr_string() throws NdrException { align(4); int i = index; String val = null; int len = Encdec.dec_uint32le(buf, i); i += 12; if (len != 0) { len--; int size = len * 2; try { if (size < 0 || size > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE ); val = new String(buf, i, size, "UnicodeLittle"); i += size + 2; } catch( UnsupportedEncodingException uee ) { } } advance(i - index); return val; } private int getDceReferent(Object obj) {
public String dec_ndr_string () throws NdrException { align ( 4 ); int i = index; String val = null; int len = Encdec.dec_uint32le ( buf, i ); i += 12; if ( len != 0 ) { len--; int size = len * 2; try { if ( size < 0 || size > 0xFFFF ) throw new NdrException ( NdrException.INVALID_CONFORMANCE ); val = new String ( buf, i, size, "UnicodeLittle" ); i += size + 2; } catch ( UnsupportedEncodingException uee ) { } } advance ( i - index ); return val; }