public static ConsoleBuffer FromFile(string path)
{
using(BinaryReader reader = new BinaryReader(File.Open(path, FileMode.Open)))
{
int width = reader.ReadInt32();
int height = reader.ReadInt32();
BufferUnitInfo[,] bufferData = new BufferUnitInfo[height, width];
BufferUnitInfo temp = new BufferUnitInfo();
for(int i = 0; i < width; i++)
for(int j = 0; j < height; j++)
{
temp._attrs = reader.ReadInt16();
temp.CharData = reader.ReadChar();
bufferData[j, i] = temp;
}
return new ConsoleBuffer(width, height, bufferData);
}
}