Page content

Buffer Protocol

  • It provides a way to access the internal data of an object.
    • Internal data is a memory array or buffer.
  • Certain objects available in Python wrap access to an underlying memory array or buffer, including
    • bytes
    • bytearray
    • array.array


Data buffer

  • A region of physical memory storage used to temporarily store data while it is being moved from one place to another, typically in the computer’s memory.
  • A buffer may be used when moving data between processes within a computer.
  • Buffers can be implemented
    • in a fixed memory location in hardware or
    • by using a virtual data buffer in software, pointing at a location in the physical memory.
  • In all cases, the data stored in a data buffer are stored on a physical storage medium.
  • Each application can allocate and deallocate its buffers from the general memory pool.