thesis/byte-reader-writer

An implementation for thesis/byte-order.

0.1.0 2025-01-17 12:25 UTC

This package is auto-updated.

Last update: 2025-01-17 12:52:19 UTC


README

Installation

composer require thesis/byte-reader-writer

Basic usage

<?php

declare(strict_types=1);

use Thesis\ByteReaderWriter\ReaderWriter;
use Thesis\ByteReader\Reader;

$rw = new ReaderWriter(
    /* an implementation of Thesis\ByteReader\Reader or Thesis\ByteReader\Reader|Thesis\ByteReader\Writer */,
    /* an implementation of ?Thesis\ByteReader\Writer */
);

$rw
    ->writeUint16(4)
    ->write('test');

echo $rw->read($rw->readUint16()); // test