Exception when reuse toStream on same object(without change value of field)
Mararok opened this issue · 1 comments
Mararok commented
I found some problem :(
When I called toStream second time on message without any changes it's throws me Exception
Reproduce instruction:
- .proto file with bytes field
import "php.proto";
message Test {
required bytes foo = 1;
}
- script used generated class
$data = new Test();
$data->setFoo("foo");
$data->toStream();
$data->toStream();
Will produce exception on second call toStream:
RuntimeException: Failed to write stream with 3 bytes in vendor/protobuf-php/protobuf/src/Stream.php:238
FabioBatSilva commented