C# Writing to file implementation, correct imports of using, logical
mapping of Java write to C# Write