90 isolate_input_file):
91 """Generates C++ file based on a input_cc_file template and two binary files
92
93 Template is expected to have two %s placeholders which would be filled
94 with binary contents of the given files each formatted as a comma separated
95 list of integers.
96 """
97 snapshot_cc_text = open(input_cc_file).
read()
98 chunks = snapshot_cc_text.split("%s")
99 if len(chunks) != 3:
100 raise Exception("Template %s should contain exactly two %%s occurrences"
101 % input_cc_file)
102
103 with open(output_file, 'w') as out:
104 out.write(chunks[0])
105 WriteBytesAsText(out, vm_isolate_input_file)
106 out.write(chunks[1])
107 WriteBytesAsText(out, isolate_input_file)
108 out.write(chunks[2])
109
110
static bool read(SkStream *stream, void *buffer, size_t amount)