Simple: the prefix is the lengths. If you try with the code you actually wrote here, (and fix the compilation error - it should be "filestream.Close()" - you will find that the file contains
0x05 - number of characters in the string "hello"
0x03 - number of characters in the string "AAA"
The version of this in your application had a string of ten characters to start with, rather than five