trying to write files of dynamic size with BinaryWriter