def METHOD_NAME(self, n, s):
    if n < 0:
        raise ValueError('fstring size must be nonnegative')
    data = s[:n]
    n = ((n+3)//4)*4
    data = data + (n - len(data)) * b'\0'
    self.__buf.write(data)