/** * Store a single byte. * * @param \Protobuf\Stream $stream * @param integer $value */ public function writeByte(Stream $stream, $value) { $stream->write(chr($value), 1); }
/** * @expectedException \RuntimeException * @expectedExceptionMessage Failed to write 2 bytes */ public function testWriteException() { $handle = fopen('php://temp', 'w+'); $stream = new Stream($handle); $stream->write('', 2); }