Now writes an encoded binary representation to file