NameOrId read_ordinal () {
int i = read_int16 ();
if ((i & 0xffff) != 0) {
int j = read_int16 ();
return new NameOrId (j);
}
else {
byte[] chars = new byte [16];
int pos = 0;
while (true) {
int j = read_int16 ();
if (j == 0)
break;
if (pos == chars.Length) {
byte[] new_chars = new byte [chars.Length * 2];
Array.Copy (chars, new_chars, chars.Length);
chars = new_chars;
}
chars [pos] = (byte)(j >> 8);
chars [pos + 1] = (byte)(j & 0xff);
pos += 2;
}
return new NameOrId (new String (Encoding.Unicode.GetChars (chars, 0, pos)));
}
}