'Returns a string of characters from the stream up to but not
including any character in \'characters\' or EOF. \'characters\' must be
a container that supports the \'in\' method and iteration over its
characters.'

def charsUntil(self, characters, opposite=False):

    try:
        chars = charsUntilRegEx[(characters, opposite)]
    except KeyError:
        if __debug__:
            for c in characters:
                assert (ord(c) < 128)
        regex = u''.join([(u'\\x%02x' % ord(c)) for c in characters])
        if (not opposite):
            regex = (u'^%s' % regex)
        chars = charsUntilRegEx[(characters, opposite)] = re.compile((u'[%s]+' % regex))
    rv = []
    while True:
        m = chars.match(self.chunk, self.chunkOffset)
        if (m is None):
            if (self.chunkOffset != self.chunkSize):
                break
        else:
            end = m.end()
            if (end != self.chunkSize):
                rv.append(self.chunk[self.chunkOffset:end])
                self.chunkOffset = end
                break
        rv.append(self.chunk[self.chunkOffset:])
        if (not self.readChunk()):
            break
    r = u''.join(rv)
    return r
