Methods Summary |
---|
public void | advance(int n)
index += n;
if ((index - start) > deferred.length) {
deferred.length = index - start;
}
|
public int | align(int boundary)
int m = boundary - 1;
int i = index - start;
int n = ((i + m) & ~m) - i;
advance(n);
return n;
|
public int | align(int boundary, byte value)
int n = align(boundary);
int i = n;
while (i > 0) {
buf[index - i] = value;
i--;
}
return n;
|
public long | dec_ndr_hyper()
align(8);
long val = Encdec.dec_uint64le(buf, index);
advance(8);
return val;
|
public int | dec_ndr_long()
align(4);
int val = Encdec.dec_uint32le(buf, index);
advance(4);
return val;
|
public int | dec_ndr_short()
align(2);
int val = Encdec.dec_uint16le(buf, index);
advance(2);
return val;
|
public int | dec_ndr_small()
int val = buf[index] & 0xFF;
advance(1);
return val;
|
public java.lang.String | dec_ndr_string()
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, "UTF-16LE");
i += size + 2;
} catch( UnsupportedEncodingException uee ) {
}
}
advance(i - index);
return val;
|
public jcifs.dcerpc.ndr.NdrBuffer | derive(int idx)
NdrBuffer nb = new NdrBuffer(buf, start);
nb.index = idx;
nb.deferred = deferred;
return nb;
|
public void | enc_ndr_hyper(long h)
align(8);
Encdec.enc_uint64le(h, buf, index);
advance(8);
|
public void | enc_ndr_long(int l)
align(4);
Encdec.enc_uint32le(l, buf, index);
advance(4);
|
public void | enc_ndr_referent(java.lang.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 | enc_ndr_short(int s)
align(2);
Encdec.enc_uint16le((short)s, buf, index);
advance(2);
|
public void | enc_ndr_small(int s)
buf[index] = (byte)(s & 0xFF);
advance(1);
|
public void | enc_ndr_string(java.lang.String s)
align(4);
int i = index;
int len = s.length();
Encdec.enc_uint32le(len + 1, buf, i); i += 4;
Encdec.enc_uint32le(0, buf, i); i += 4;
Encdec.enc_uint32le(len + 1, buf, i); i += 4;
try {
System.arraycopy(s.getBytes("UTF-16LE"), 0, buf, i, len * 2);
} catch( UnsupportedEncodingException uee ) {
}
i += len * 2;
buf[i++] = (byte)'\0";
buf[i++] = (byte)'\0";
advance(i - index);
|
public byte[] | getBuffer()
return buf;
|
public int | getCapacity()
return buf.length - start;
|
private int | getDceReferent(java.lang.Object obj)
Entry e;
if (referents == null) {
referents = new HashMap();
referent = 1;
}
if ((e = (Entry)referents.get(obj)) == null) {
e = new Entry();
e.referent = referent++;
e.obj = obj;
referents.put(obj, e);
}
return e.referent;
|
public int | getIndex()
return index;
|
public int | getLength()
return deferred.length;
|
public int | getTailSpace()
return buf.length - index;
|
public void | readOctetArray(byte[] b, int i, int l)
System.arraycopy(buf, index, b, i, l);
advance(l);
|
public void | reset()
this.index = start;
length = 0;
deferred = this;
|
public void | setIndex(int index)
this.index = index;
|
public void | setLength(int length)
deferred.length = length;
|
public java.lang.String | toString()
return "start=" + start + ",index=" + index + ",length=" + getLength();
|
public void | writeOctetArray(byte[] b, int i, int l)
System.arraycopy(b, i, buf, index, l);
advance(l);
|