什么是“块",“块",“偏移",“缓冲区"和“扇区"?意思是? [英] What do "chunk", "block", "offset", "buffer", and "sector" mean?

查看:421
本文介绍了什么是“块",“块",“偏移",“缓冲区"和“扇区"?意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到一些处理存档或二进制数据或复制文件(不使用python默认功能)的脚本使用 chunk block 偏移量缓冲区扇区.

I have seen some of the scripts which are either dealing with archive or binary data or copy files (not using python default functions) use chunk or block or offset or buffer or sector.

我已经创建了一个Python应用程序,外部库(归档/提取数据)或二进制文件满足了很少的要求.我现在想更深入地研究,以通过编写自己的模块将那些第三方库功能纳入我的应用程序.现在,我想知道这些术语的含义以及从哪里开始.上面有关于此主题的任何文档吗?

I have created a Python application and few of the requirements have been met by external libraries (archival / extracting data) or binaries. I would like to dive deeper now to get those third party library features into my application by writing a module of my own. Now I would like to know what those terms mean and where I can get started. Is there any documentation for the subject above?

与Python编程语言上的这些单词相关的任何文档也将受到赞赏.

Any documentation relevant to those words on the Python programming language would also be appreciated.

推荐答案

Chunk 用于任何(通常相当大)数据量,而这些数据仍然只是 any 的一部分整体大小,e. G.文件的前1000个字节.接下来的3000个字节可以是下一个 chunk .

Chunk is used for any (typically rather large) amount of data which still is only a part of any size of a whole, e. g. the first 1000 bytes of a file. The next 3000 bytes could be the next chunk.

用于固定数量的数据(通常由技术确定),该数据通常只是整体的一部分,例如. G.文件的前1024个字节.那么下一个块也将是1024字节长.另外,有时并非所有块都被使用; 1034字节文件的第二个也是最后一个块仍然是1024字节大,但是只有10字节会被使用.

Block is used for a fixed amount of data (typically technically determined) which typically is only part of a whole, e. g. the first 1024 bytes of a file. The next block would then also be 1024 bytes long. Also, sometimes not all of a block is used; the second and last block of a file of 1034 bytes is still 1024 bytes large, but only 10 bytes of it will be in use.

偏移量是一个位置距离,通常介于某物的起点和感兴趣的位置之间; e. G.如果天气数据文件中的第23个字节存储了温度,则温度的偏移量为23个字节.也可以是数据位置的 shift . G.如果出了什么问题现在文件已损坏,这可能是因为所有字节向后移了32个字节(在开头或类似位置插入32个零之后),所以整个文件都有一个 offset 的32个字节.

Offset is a positional distance, typically between the beginning of something and the position of interest; e. g. if the 23rd byte in a file of weather data stores the temperature, then the temperature's offset is 23 bytes. It can also be a shift of a data position, e. g. if something has gone wrong and now a file is corrupted, this can be because all bytes are shifted 32 bytes to the back (after inserting 32 zeros at the beginning or similar), then the whole file has an offset of 32 bytes.

缓冲区是一块内存,用于在缓冲区已满(或接近已满)时将事物收集为一个整体进行处理.一个典型的例子是缓冲输出;在这里,单个字符被缓冲直到一行完成,然后通过一次写操作将整行打印到终端.有时候缓冲区的大小是固定的,有时只是一个上限.

Buffer is a piece of memory in which things are collected in order to process them as a whole when the buffer is full (or nearly full). A typical example is buffered output; here single characters are buffered until a line is complete, and then the whole line is printed to the terminal in one write operation. Sometimes buffers have a fixed size, sometimes they just have an upper limit.

部门就像一个区块,是整体的固定大小部分,但与技术渊源的关系更大.在这种情况下,整体通常是一块硬件(例如硬盘驱动器或CD),并且通常扇区包含 blocks .

Sector is like a block, a fixed size part of a whole, but related even more to a technical origin. The whole in this case often is a piece of hardware (like a hard drive or a CD), and typically sectors contain blocks.

这篇关于什么是“块",“块",“偏移",“缓冲区"和“扇区"?意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆