public static void Head(String filePath, Int32 bytes) { if (!File.Exists(filePath)) { throw new Exception("File doesn't exists."); } using (FileStream handle = File.OpenRead(filePath)) { var data = CInterop.ReadToEndAsASCII(handle); Console.WriteLine(String.Join(" ", data.Take(bytes).Select(ch => ch + $"({( ( Int32 ) ch ).ToString ( "X2" )})"))); } }
public GLuaLexer(Stream input) : this(CInterop.ReadToEndAsASCII(input)) { }