def read(self, buf, n):
        """
        :type buf: Destination buffer (List[str])
        :type n: Maximum number of characters to read (int)
        :rtype: The number of characters read (int)
        """
        pos, eof = 0, False
        while not eof and pos < n:
            if self.bufsize == 0:
                self.bufsize = read4(self.buff)
                eof = self.bufsize < 4
            byte = min(n - pos, self.bufsize)
            for i in range(byte):
                buf[pos + i] = self.buff[self.offset + i]
            self.offset = (self.offset + byte) % 4
            self.bufsize -= byte
            pos += byte
        return pos

        :type buf: Destination buffer (List[str])
        :type n: Maximum number of characters to read (int)
        :rtype: The number of characters read (int)
        
python/158_Read_N_Characters_Given_Read4_II_Call_multiple_times.py