get_sub_buffer

Buffer.get_sub_buffer(size: int, offset: int = 0)

Retrieves a sub-buffer that shares the same memory as the original buffer.

Parameters:
  • size (int) -- The size of the sub-buffer in bytes.

  • offset (int) -- The starting position within the buffer in bytes. Defaults to 0.

Returns:

A sub-buffer representing the specified portion of the original buffer.

Return type:

Buffer