int ReadHuffmanCodeMSB(byte[] nodes)
{
int next, index = 1;
while (nodes[index] != 0) {
if (Input.BooleanMSB()) {
next = nodes[index] & 0x0F;
if (next == 0) {
return Input.ReadMSB(8) | 0x100;
}
} else {
next = (nodes[index] & 255) >> 4;
}
index += next << 1;
}
return (nodes[index - 1] & 255) | ((nodes[index] & 255) << 8);
}