code: function deserializeInnerMessage(spec, message, buffer, bufferOffset) {
    spec.fields.forEach(function(field) {
      var fieldValue = message[field.name];
  
      if (field.isArray) {
        var array     = [];
        var arrayType = field.baseType;
  
        var arraySize;
        if (field.arrayLen !== null) {
          arraySize = field.arrayLen;
        } else {
          arraySize = buffer.readUInt32LE(bufferOffset[0]);
          bufferOffset[0] += 4; // only for variable length arrays
        }
  
        let ArrayMsgClass;
        let isPrimitive = field.isBuiltin;
        if (!isPrimitive) {
          ArrayMsgClass = getMessageFromRegistry(arrayType, 'msg');
        }
  
        for (var i = 0; i < arraySize; i++) {
          if (isPrimitive) {
            var value = fieldsUtil.deserializePrimitive(
              arrayType, buffer, bufferOffset);
            array.push(value);
          }
          else { // is message
            var arrayMessage = new ArrayMsgClass();
  
            arrayMessage = deserializeInnerMessage(spec.getMsgSpecForType(arrayType),
              arrayMessage, buffer, bufferOffset);
  
            array.push(arrayMessage);
          }
        }
        fieldValue = array;
      }
      else if (field.isBuiltin) {
        fieldValue = fieldsUtil.deserializePrimitive(
          field.type, buffer, bufferOffset)
      }
      else { // is message
        var innerMessage = new getMessageFromRegistry(field.baseType, 'msg')();
        fieldValue = deserializeInnerMessage(spec.getMsgSpecForType(field.baseType),
          innerMessage, buffer, bufferOffset);
      }
  
      message[field.name] = fieldValue;
    });
  
    return message;
  }
docs: --------------------------------------------------------- Deserialize