Download the PHP package pigeonboys/php-binary-parser without Composer
On this page you can find all versions of the php package pigeonboys/php-binary-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download pigeonboys/php-binary-parser
More information about pigeonboys/php-binary-parser
Files in pigeonboys/php-binary-parser
Download pigeonboys/php-binary-parser
More information about pigeonboys/php-binary-parser
Files in pigeonboys/php-binary-parser
Vendor pigeonboys
Package php-binary-parser
Short Description A PHP library for parsing binary data, with full support for signed/unsigned integers and endian-aware formats.
License MIT
Package php-binary-parser
Short Description A PHP library for parsing binary data, with full support for signed/unsigned integers and endian-aware formats.
License MIT
Please rate this library. Is it a good library?
Informations about the package php-binary-parser
PhpBinaryParser
A lightweight PHP library for parsing binary data from byte arrays. Supports signed and unsigned integers, arrays, and endian-aware formats (big/little endian). Ideal for reading hardware data streams, binary protocols, or any low-level byte-oriented data.
Features
- Supports 8, 16, 24, 32, and 64-bit integers
- Signed and unsigned parsing
- Little-endian and big-endian support
- Bytes are consumed from the buffer after each read
- Multi-read support (
readMany()) - Resettable buffer with
resetBuffer() - Type-safe with meaningful exceptions
Installation
You can install via Composer:
PHP version 8.0+ is required.
Usage
Basic Usage
Reading Multiple Values
Resetting Buffer
Methods
int8(),int16(),int24(),int32(),int64()— Set the bitnesssigned(),unsigned()— Set the signednesslittleEndian(),bigEndian()— Set the endiannessread()— Read a single value and consume bytes from the bufferreadMany(int $count)— Read multiple values and consume bytes from the bufferresetBuffer()— Reset buffer to original contentbytesRemaining()— Get the number of bytes left
Exceptions
BitnessAlreadySetException— Thrown if you try to set the bitness more than once before reading.EndiannessAlreadySetException— Thrown if you try to set the endianness more than once before reading.SignednessAlreadySetException— Thrown if you try to set signedness more than once before reading.BitnessNotSetException— Thrown if you attempt to read an integer without first specifying the bitness.EndiannessNotSetException— Thrown if you attempt to read a multi-byte integer without specifying endianness (except 8-bit).SignednessNotSetException— Thrown if you attempt to read an integer without specifying signed or unsigned.InvalidLengthException— Thrown if the number of bytes requested forreadBytes()is less than 1.InvalidCountException— Thrown ifreadMany()is called with a count less than 1.CurrentBufferUnderflowException— Thrown if there are not enough bytes left in the buffer to satisfy a read.
All versions of php-binary-parser with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package pigeonboys/php-binary-parser contains the following files
Loading the files please wait ...