Most likely, Vi adds a trailing linefeed. There used to be whole flame wars whether editors should add a trailing linefeed for the content.
It is a convention, that differs between Windows (there you would usually talk about line separators) while on Unix like operating systems one usually speaks about line terminators. (The most convincing argument for using terminators for me was using something like
cat file1 file2 so that the when the lines from the second file are output, they start at a new line.)
However, to disable this behaviour, you can start Vim in binary mode (which as the name suggest should be used for editing binary files and resets quite a couple of options that might unintentionally change your file, which you can read at the documentation: :h 'binary'). For normal files however, you can nowadays also set the 'endofline' or 'fixendofline' option, which simply disables writing the final line termination character.
(Note: the 'endofline' option only works when the 'binary' option is set, which is usually suboptimal, so if you really need this, I would recommend unsetting the 'fixeol' option).