I've the following .proto file:
message MediatorMessageMsg{
required double speed = 1;
required double heading = 2;
required string sender = 3;
}
and I use Eclipse Mars with Protocol Buffer 2.5.0 version. It generates the necessary file (which we are not supposed to edit) however I cannot use the important functions of
- writeDelimitedTo()
- parseDelimitedFrom()
- newBuilder().set...
without these there is simply no point in using the entire thing. I checked the file and I can see parseDelimitedFrom() there, however I cannot call it in my own project (Yes, imported already). When I hover my mouse on the error, it gives me the following:
The method parseDelimitedFrom(ByteArrayInputStream) is undefined for the type MediatorMessage
Anyone has an idea why is this the case?
EDIT: Some more details regarding the question.
I cannot use the function below, for instance, to build my message. It raises an error.
MediatorMessage mediatorMessage = MediatorMessage.newBuilder().
or I cannot do this
ByteArrayOutputStream output = new ByteArrayOutputStream(bufferSize);
mediatorMessage.writeDelimitedTo(output);
or this
ByteArrayInputStream firstInput = new ByteArrayInputStream(buf);
mediatorMessageOne = MediatorMessage.parseDelimitedFrom(firstInput);
So these functions are not recognized for some reason.
MediatorMessageMsgand in the cited error it mentionMediatorMessage.