Visual Basic
C#
Managed Extensions for C++
C++/CLI
Use Close method to correctly close the stream and release the associated resources.