'Write an entry to a jar, creating a new one if necessary.
If the total uncompressed size of all the entries written to the current jar
excludes the maximum, the current jar will be closed and a new one created.
Args:
size: the size in bytes of the new entry, uncompressed.
write_func: a function that writes that entry to self.current_jar.'

def _WriteEntry(self, size, write_func):

    if ((self.current_jar_size + size) > self.maximum_size):
        self.current_jar.close()
        self.current_jar = None
    if (not self.current_jar):
        jar_name = ('%s-%04d.jar' % (self.base_name, self.jar_suffix))
        self.jar_suffix += 1
        full_jar_name = os.path.join(self.output_directory, jar_name)
        self.current_jar = zipfile.ZipFile(full_jar_name, 'w', zipfile.ZIP_DEFLATED)
        self.current_jar_size = 0
    self.current_jar_size += size
    write_func()
