static void ReadData(Stream data, ref byte[] buffer) { if (data.Read(buffer, 0, buffer.Length) < buffer.Length) throw new PNGMaskException("Unexpected EOF, PNG corrupt?"); }