Added FlushEncoder method and ported a lot of code over from the MacTruck side