I am working on a program that reads characters from a data file (either 0, 1, or 2) and draws the corresponding colored rectangle using GDI+. The way it is set up is I have a loop that reads one character (using StreamReader.read() )and draws the rectangle, it repeats the process until it reaches the end of the text file.

The program works fine, but my question is, is this the best and fastest way to do it, or would it be better to write the file or characters to an array and then draw from the array?