Make your class implement Serializable.
Open an ObjectOutputStream wrapping a FileOutputStream
write the entire List with writeObject()
close the ObjectOutputStream.
More Related Contents:
- Write byte array to file in java
- Assign ArrayList to File[] in java
- How do I create a Java string from the contents of a file?
- How do I save a String to a text file using Java?
- Java: How to read a text file
- Java IO implementation of unix/linux “tail -f”
- How to create a temporary directory/folder in Java?
- Reliable File.renameTo() alternative on Windows?
- What is simplest way to read a file into String? [duplicate]
- Inserting text into an existing file via Java
- How to Write text file Java
- Java FileOutputStream Create File if not exists
- How do I use Java to read from a file that is actively being written to?
- Elegant way to read file into byte[] array in Java [duplicate]
- Check line for unprintable characters while reading text file
- Writing a file to sdcard
- File truncate operation in Java
- Whole text file to a String in Java
- Java BufferedReader back to the top of a text file?
- java IO to copy one File to another
- How to append data to a file?
- Reading from a text file and storing in a String [duplicate]
- ArrayList Data Structure – Daily Temperature
- edit object/arrayList in java again and again [closed]
- Delete directories recursively in Java
- In Java how do you sort one list based on another?
- Quickly read the last line of a text file?
- How to iterate an ArrayList inside a HashMap using JSTL?
- How can I create an Array of ArrayLists?
- Accessing a file inside a .jar file [duplicate]