void output_frame_footer(BitWriter bitwriter) { bitwriter.flush(); ushort crc = crc16.ComputeChecksum(frame_buffer, 0, bitwriter.Length); bitwriter.writebits(16, crc); bitwriter.flush(); }