public function testReadBytesShouldReturnSubsetOfStringFromCurrentNeedle() { $string = 'this is a short stream'; $stream = new Util\BinaryStream($string); $test = $stream->readBytes(4); $this->assertEquals('this', $test); $test = $stream->readBytes(5); $this->assertEquals(' is a', $test); }