Skip to main content
# PyByteBuffer

A library to manipulate buffers inspired by [Java nio ByteBuffer](https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html)


## Setup

```
pip3 install PyByteBuffer
```

## Usage

```python
from PyByteBuffer import ByteBuffer

buf = ByteBuffer.allocate(50)
# write byte 0x10 and increment position by 1
buf.put(0x10)
buf.put([0xcc, 0xdd, 0xee])
buf.put('something')
buf.put(bytes([00] * 4))

# endianness
buf.put(123456, 'little')
buf.put(1234561434234234, 'big')

# read 1 byte and increment position by 1
value = buf.get(1)
# read 10 bytes little endian and increment position by 10
value = buf.get(10, 'little')

# other allocations
buf = ByteBuffer.from_hex('deadbeef')
buf = ByteBuffer.wrap(bytes())
```

## About performances
The performance analysis we can do in this library is all around the conversion between int->bytes bytes<-int.

Tested with a cycle of 1/100/500/1000 conversion using python3 builtin api int.to_bytes/from_bytes, struct pack/unpack and a "primitive" solution
posted in [stackoverflow](https://stackoverflow.com/a/35634239)

Metadata

Release files for PyByteBuffer 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for PyByteBuffer 1.0.2
File Interpreter ABI Platform Actions
PyByteBuffer-1.0.2-py3-none-any.whl Python 3 none any Details for PyByteBuffer-1.0.2-py3-none-any.whl

Release files / PyByteBuffer-1.0.2-py3-none-any.whl

Download URL PyByteBuffer-1.0.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
739f583be5bbbf5d483290a76db922d9114b5aa4a335e718af5773962ef18494
BLAKE2b-256 checksum
How to use checksums
ea37040c0b8d1e46ca86391610a4bade0149e5874247348c5cf6edf977e3d6ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Security for PyByteBuffer 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page