Merge "Use templates for write*Vector methods"