public void Load(string filename)
{
using (FileStream stream = File.OpenRead(filename))
{
int playbackCommandTotal =
stream.ReadByte() |
(stream.ReadByte()) << 8 |
(stream.ReadByte()) << 16 |
(stream.ReadByte()) << 24;
this.currentBrushSize =
stream.ReadByte() |
(stream.ReadByte()) << 8 |
(stream.ReadByte()) << 16 |
(stream.ReadByte()) << 24;
this.currentColor.A = (byte)stream.ReadByte();
this.currentColor.R = (byte)stream.ReadByte();
this.currentColor.G = (byte)stream.ReadByte();
this.currentColor.B = (byte)stream.ReadByte();
var totalCommandBytes= playbackCommandTotal * BytesPerCommand;
byte[] commands = new byte[totalCommandBytes];
stream.Read(commands, 0, totalCommandBytes);
this.commandList = new List<byte>(commands);
}
}