Reputation: 8853
I have used protoc
to generate Java source from
https://github.com/mapbox/vector-tile-spec/blob/master/2.1/vector_tile.proto
The protobuf documentation suggests that the resulting class should support a toByteArray
method. It doesn't. (As well as trying to call it, I have searched the generated file VectorTile.java
and there is no toByteArray
code in there.)
NB. this is not a duplicate of Protobuf - Missing toByteArray()? -- the error there is using a Builder where a Message is intended. I'm not doing that.
I'd be grateful for any insights.
Upvotes: 0
Views: 686
Reputation: 45246
The toByteArray()
method is implemented in AbstractMessageLite
, which the generated code inherits. There isn't a declaration of toByteArray()
in the generated code because it is inherited. Calling message.toByteArray()
will work fine -- if it isn't working for you, please show your code and the error message produced.
Upvotes: 1