public void DecodeRLE()
{
for (int i = 0; i < h; i++) {
// Decode the line.
DecodeNextScanline();
// Advance to the next byte boundary if not already there.
if (bitPointer != 0) {
bytePointer++;
bitPointer = 0;
}
// Update the total number of bits.
lineBitNum += bitsPerScanline;
}
}