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;

$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