public void write()
    {
        try
        {
            OutputStream out = null;
            try
            {
                try
                {
                    String temp = Paths.get(getClass().getResource(path).toURI()).toFile().toString();
                    int x = temp.indexOf("\\GridGame\\");
                    temp = temp.substring(0, x + 10) + "res\\test.mf";
                    out = new BufferedOutputStream(new FileOutputStream(temp));
                    out.write(data);
                } catch (URISyntaxException ex) {
                    Logger.getLogger(MapEditor.class.getName()).log(Level.SEVERE, null, ex);
                }
                
            }
            finally
            {
                //out.close();
            }
        }
        catch (IOException ex) 
        {
            System.out.println(ex.getMessage());
        }
    }