def METHOD_NAME(self, length):
    if self.raw_buffer is None:
        return
    self.buffer = self.buffer[self.pointer:]
    self.pointer = 0
    while len(self.buffer) < length:
        if not self.eof:
            self.update_raw()
        if self.raw_decode is not None:
            try:
                data, converted = self.raw_decode(self.raw_buffer,
                        'strict', self.eof)
            except UnicodeDecodeError as exc:
                character = self.raw_buffer[exc.start]
                if self.stream is not None:
                    position = self.stream_pointer-len(self.raw_buffer)+exc.start
                else:
                    position = exc.start
                raise ReaderError(self.name, position, character,
                        exc.encoding, exc.reason)
        else:
            data = self.raw_buffer
            converted = len(data)
        self.check_printable(data)
        self.buffer += data
        self.raw_buffer = self.raw_buffer[converted:]
        if self.eof:
            self.buffer += '\0'
            self.raw_buffer = None
            break