Example #1
0
 public void enc_ndr_referent(Object obj, int type) {
   if (obj == null) {
     enc_ndr_long(0);
     return;
   }
   switch (type) {
     case 1: /* unique */
     case 3: /* ref */
       enc_ndr_long(System.identityHashCode(obj));
       return;
     case 2: /* ptr */
       enc_ndr_long(getDceReferent(obj));
       return;
   }
 }
 public void encode(NetworkDataRepresentation ndr, NdrBuffer dst) {
   int padding = dst.align(4, (byte) 0);
   dst.enc_ndr_small(authenticationService);
   dst.enc_ndr_small(protectionLevel);
   dst.enc_ndr_small(padding);
   dst.enc_ndr_small(0); // Reserved
   dst.enc_ndr_long(contextId);
   System.arraycopy(body, 0, dst.getBuffer(), dst.getIndex(), body.length);
   // dst.index += body.length;
   dst.advance(body.length);
 }