Answer the question
In order to leave comments, you need to log in
Why doesn't protobuf understand array in parseFrom?
Trying to deserialize data using protobuf methods:
Googl says :
parseFrom(byte[] data);: разбирает сообщение из заданного массива байтов.
try {
Protocol.response response = Protocol.response.parseFrom(readBuf);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
byte[] readBuf = (byte[]) msg.obj;
enum response_type {
OK = 1;
BUSY = 2;
ERROR = 3;
}
message response {
required response_type resp = 1;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question