Dreamland/Program.cs
/// <summary>
/// Reads a null-terminated string from a binary file
/// </summary>
/// <param name="stream">The reader of which to read from</param>
/// <returns>The null-terminated string</returns>
Reads a null-terminated string from a binary file
Reads a null - terminated string from a binary file
public static string ReadNullTerminatedString(this BinaryReader stream)
        {
            string str = "";
            char ch;
            while ((int)(ch = stream.ReadChar()) != 0)
            {
                str = str + ch;
            }
            return str;
        }
public static string ReadNullTerminatedString ( this BinaryReader stream ) { string str = " " ; char ch ; while ( ( int ) ( ch = stream . ReadChar ( ) ) != 0 ) { str = str + ch ; } return str ; }
Reads a null-terminated string from a binary file
Reads a null - terminated string from a binary file
// Base // Buffer // Loop until null // Append char // Return result
The null-terminated string
The null - terminated string
BinaryReader
this
stream
The reader of which to read from
The reader of which to read from