'Set the stream\'s file pointer to pos. Negative seeking
is forbidden.'

def seek(self, pos=0):

    if ((pos - self.pos) >= 0):
        (blocks, remainder) = divmod((pos - self.pos), self.bufsize)
        for i in xrange(blocks):
            self.read(self.bufsize)
        self.read(remainder)
    else:
        raise StreamError('seeking    backwards    is    not    allowed')
    return self.pos
