encodeGroupField function

List<int> encodeGroupField(
  1. List<int> buffer,
  2. int fieldNumber,
  3. List<int> body
)

Encodes a message field using DELIMITED (group) wire format: a START_GROUP tag (wire type 3), the submessage body, then a matching END_GROUP tag (wire type 4). This is the editions message_encoding = DELIMITED representation (and the proto2 group encoding). Unlike length-prefixed (wire type 2) the body is NOT length-prefixed — it is terminated by the END_GROUP tag.

Implementation

List<int> encodeGroupField(List<int> buffer, int fieldNumber, List<int> body) {
  encodeTag(buffer, fieldNumber, _wtSGroup);
  buffer.addAll(body);
  encodeTag(buffer, fieldNumber, _wtEGroup);
  return buffer;
}