Beispiel #1
0
 /// <summary>
 /// Creates a <see cref="NullContext"/> from the specified byte array.
 /// </summary>
 /// <param name="buffer">The buffer to read the <see cref="NullContext"/> from.</param>
 /// <returns>The <see cref="NullContext"/> this method creates.</returns>
 public static NullContext FromMemory(byte[] buffer)
 {
     return(NullContext.FromString(UTF8Encoding.UTF8.GetString(buffer)));
 }
Beispiel #2
0
 /// <summary>
 /// Creates a <see cref="NullContext"/> from the specified file.
 /// </summary>
 /// <param name="fileName">A string that contains the name of the file from which to create the <see cref="NullContext"/>.</param>
 /// <returns>The <see cref="NullContext"/> this method creates.</returns>
 public static NullContext FromFile(string fileName)
 {
     return(NullContext.FromString(File.ReadAllText(fileName, Encoding.UTF8)));
 }