Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
/ zero_buffer Public archive

zero_buffer is a high-performance, zero-copy, implementation of a byte-buffer for Python.

Notifications You must be signed in to change notification settings

alex/zero_buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jul 7, 2014
ddc9e9c · Jul 7, 2014
Nov 9, 2013
Nov 9, 2013
Jul 7, 2014
Jul 27, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Nov 9, 2013
Jul 7, 2014
Nov 9, 2013
Jul 7, 2014

Repository files navigation

zero_buffer

https://travis-ci.org/alex/zero_buffer.png?branch=master

zero_buffer is a high-performance, zero-copy, implementation of a byte-buffer for Python.

Documentation is available on ReadTheDocs.

from zero_buffer import Buffer

# Create a buffer which has space for 8192 bytes.
b = Buffer.allocate(8192)
with open(path, "rb") as f:
    # Read up to 8192 bytes from the file into the buffer
    b.read_from(f.fileno())
# Create a read-only view of the buffer, this performs no copying.
view = b.view()
# Split the view on colons, this returns a generator which yields sub-views
# of the view.
for part in view.split(b":"):
    print(part)

zero_buffer works on Python 2.6, 2.7, 3.2, 3.3, and PyPy.

About

zero_buffer is a high-performance, zero-copy, implementation of a byte-buffer for Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages