java - how do you write arraylist to a binary file -


how write arraylist binary file?

lets have arraylist called people

i trying write binary file using writelisttobinary method

my method:

public void writelisttobinary (arraylist<person> inlist) throws ioexception 

in main method:

arraylist<person> people = new arraylist<person>(); writelisttobinary(people); 

i think trying serialize arraylist. implement serializable class, then:

fileoutputstream fos = new fileoutputstream(filetosaveto); objectoutputstream out = new objectoutputstream(fos); out.writeobject(people)

also take @ http://www.tutorialspoint.com/java/java_serialization.htm


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -