HighPerformanceStreamIO.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:Playground3 作者: CrimsonVista 项目源码 文件源码
def seek(self, offset, whence=io.SEEK_SET):
        self.__raiseIfClosed()
        if not self.__seekable:
            raise OSError("Seek not enabled for this stream")
        if whence == io.SEEK_SET:
            if offset < 0:
                raise ValueError("Cannot have a negative absolute seek")
            newStreamPosition = offset
        elif whence == io.SEEK_CUR:
            newStreamPosition = self.__streamPosition + whence
        elif whence == io.SEEK_END:
            if not self.__buffers:
                newStreamPosition = 0
            else:
                newStreamPosition = self.__streamEnd + offset
        self.__streamPosition = newStreamPosition
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号