C# BinaryWriter Class With Programming Examples And Codes

BinaryWriter class writes Primitive type data type as int, uint or char in binary to a stream. As its name says BinaryWriter writes binary files that uses a specific data layout for its bytes. BinaryWriter create binary file that is not human understandable but the machine can understand it more smoothly. It supports writing string in a specific encoding. BinaryWriter class provides methods that simplify writing

C# TextReader Class With Programming Example

TextReader Class represents a reader that can read a sequential series of Characters. It is abstract class that means you cannot instantiate it. After finishing reading or writing file you must disposeor clean memory directly or indirectly. To directly dispose, call Dispose Method in try/catch block and for indirectly disposal write code inside using block. Programming Examples: In this programming Example I will open D:\csharpfile.txt using

C# TextWriter Tutorial With Programming Examples

The TextWriter class represents a writer that can write sequential series of characters. You can also use this class to write text in a file. It is an abstract base class of StreamWriter and StringWriter, which write characters to streams and string respectively. Example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using

C# Destructor

Destructors are the way to remove instances of classes as soon as class closed. It is very important to clean memory and remove all the instances of program. Using of destructors you can clean memory if your program is using expensive external resource as files, image etc. Note: You should not use empty destructor in program. When you