Created
October 21, 2014 13:12
-
-
Save mikeemoo/de1b172d06bb9d8c8635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Testing bit stream:\n"; | |
$handle = fopen('80_team-ldlc-fnatic_de_dust2.dem', 'rb'); | |
$byteStream = new phpgo\IO\ByteStream($handle); | |
$stream = new phpgo\IO\BitStream($byteStream); | |
// show first int | |
var_dump($stream->int32()); | |
// read 32 bits | |
$stream->int32(); | |
// short last int | |
var_dump($stream->int32()); | |
fclose($handle); | |
echo "Testing byte stream:\n"; | |
$handle = fopen('80_team-ldlc-fnatic_de_dust2.dem', 'rb'); | |
$stream = new phpgo\IO\ByteStream($handle); | |
// show first int | |
var_dump($stream->int32()); | |
// read 32 bits | |
$stream->getBits(1); | |
$stream->getBits(1); | |
$stream->getBits(1); | |
$stream->getBits(1); | |
$stream->getBits(4); | |
$stream->getBits(24); | |
// show last int | |
var_dump($stream->int32()); | |
fclose($handle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment