optimize OutFile class write function