In saving a game, I want to add ints, Strings, booleans, etc. because that's everything in my game that I want to save. The only problem is that all I can find is how to add text to files? Nothing in there helps for finding how to add numbers and letters to a non-text file.
Right now, this is my code:
private void saveGame() {
    try {
        //Whatever the file path is.
        File statText = new File("F:/BLAISE RECOV/Java/Finished Games/BasketBall/BasketballGame_saves/Games");
        FileOutputStream is = new FileOutputStream(statText);
    } catch (IOException e) {
        System.err.println("Problem writing to the file statsTest.txt");
    }
}
 
    