flush FILE buffer and changed buffer size
fixed error in compression and added bitio flush