public void write(byte[] data) throws IOException { this.data = data; System.out.println(data.length); if (file.length() > 1000) { System.out.println("Exists"); // Prompt user to overwrite the save file // Allow user to overwrite save file } else { try { FileOutputStream out = new FileOutputStream(file); out.write(data); out.close(); // IOUtils.write(data, output); } catch (Exception e) { e.printStackTrace(); } } }