Varint stream processor

dev-master 2021-03-07 17:51 UTC

This package is auto-updated.

Last update: 2024-12-08 02:25:55 UTC


README

Varint streams can be used to delimit binary messages without expending the stream size significantly. They are especially useful for message formats without inherent delimiting (e.g. protobuf).

Usage

Decoding a stream as strings

use Cjm\Varint\Stream\Decoder;

$decoder = Decoder::fromPath('php://stdin');

foreach($decoder->strings() as $string) {
   // do something with the message
}