PHP code example of thesis / byte-reader-writer

1. Go to this page and download the library: Download thesis/byte-reader-writer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thesis / byte-reader-writer example snippets




declare(strict_types=1);

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

$rw = new ReaderWriter(
    reader: /* an implementation of Reader or Reader&Writer */,
    writer: /* an implementation of Writer or null */,
);

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

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