def METHOD_NAME(self, size):
    s = 'x' * 2**26 # 64 MiB
    f = self.MODULE.StringIO()
    n = size
    while n > len(s):
        f.write(s)
        n -= len(s)
    s = None
    f.write('x' * n)
    self.assertEqual(len(f.getvalue()), size)