Do not use IO.write to support ruby 1.8.