I’m on my way in developing a desktop application using netbeans(Java Dextop Application) and I need to implement my own file format which is specific to that application only. I’m quite uncertain as to how should I go about first.What code should I use so that my java application read that file and open it in a way as I want it to be.
I’m on my way in developing a desktop application using netbeans(Java Dextop Application) and
Share
If it’s character data, use
Reader/Writer. If it’s binary data, useInputStream/OutputStream. That’s it. They are available in several flavors, likeBufferdReaderwhich eases reading a text file line by line and so on.They’re part of the Java IO API. Start learning it here: Java IO tutorial.
By the way, Java at its own really doesn’t care about the file extension or format. It’s the code logic which you need to write to handle each character or byte of the file according to some file format specification (which you in turn have to writeup first if you’d like to invent one yourself).