readBytes(10 * $length); } public function testReadBytesShouldReturnSubsetOfStringFromCurrentNeedle() { $string = 'this is a short stream'; $stream = new Zend_Amf_Util_BinaryStream($string); $test = $stream->readBytes(4); $this->assertEquals('this', $test); $test = $stream->readBytes(5); $this->assertEquals(' is a', $test); } public function testBinaryStreamsShouldAllowWritingUtf8() { $string = str_repeat('赵勇', 1000); $stream = new Zend_Amf_Util_BinaryStream(''); $stream->writeLongUtf($string); $test = $stream->getStream(); $this->assertContains($string, $test); } } if (PHPUnit_MAIN_METHOD == 'Zend_Amf_Util_BinaryStreamTest::main') { Zend_Amf_Util_BinaryStreamTest::main(); }