def write(self, *pb2_obj):
base = len(self._write_buff)<EOL>for idx, obj in enumerate(pb2_obj):<EOL><INDENT>if self._buffer_size > <NUM_LIT:0> and(idx + base) != <NUM_LIT:0> and(idx + base) % self._buffer_size == <NUM_LIT:0>:<EOL><INDENT>self.flush()<EOL><DEDENT>self._write_buff.append(obj)<EOL><DEDENT>if self._buffer_size == <NUM_LIT:0>:<EOL><INDENT>self.flush()<EOL><DEDENT>
Write a group of one or more protobuf objects to the file. Multiple
        object groups can be written by calling this method several times
        before closing stream or exiting the runtime context.

        The input protobuf objects get buffered and will be written down when
        the number of buffered objects exceed the `self._buffer_size`.

        Args:
            pb2_obj (*protobuf.message.Message): list of protobuf messages.