Juia’s write is “what you see is what you get”. It behaves the same way whether you are writing to a file, a buffer in memory, or any other stream. So no, no padding or any other type of formatting, it just writes exactly what you tell it to. Granted, I’m not 100% sure how it would decide to serialize everything, but as far as I know it throws an error for anything that doesn’t have an entirely straightforward serialization. Note also that you can use it in conjunction with the stdlib Serialization.
Note also that you can of course verify the behavior with open(read, "filename") or Mmap.mmap("filename"). What is returned is an unformatted Vector{UInt8}, so in your case you’d have to do reinterpret(UInt8, Mmap.mmap("testfile")) or similar.
Thanks. Your reply was very useful. However, I think that GunnarFarneback actually answered my (rather silly) question. It does depend on the file system.