protected void OutCodeword18(int codeword) {
int bytePtr = bitPtr / 8;
int bit = bitPtr - bytePtr * 8;
outBits[bytePtr++] |= (byte)(codeword >> (10 + bit));
outBits[bytePtr++] |= (byte)(codeword >> (2 + bit));
codeword <<= 8;
outBits[bytePtr] |= (byte)(codeword >> (2 + bit));
if (bit == 7)
outBits[++bytePtr] |= 0x80;
bitPtr += 18;
}