I plan to write a Java application that works with .dat files – reads from them, updates them, etc. Do you know of any short, basic examples (code)?
I’m also interested in how to somehow protect a .dat file (make it unreadable when opening it). For example, I just converted a notepad file into .dat (by renaming it) – and when I open the .dat I can (obviously) still see the text clearly.
However, I came accross some .dat files that display all sorts of funny characters when opening them – that is protection, right? I’ve little clue on how to achieve that – I’d be grateful for any pointers.
A “.dat” file can be anything you want it to be.
A typical choice is clear-text.
Here is a nice, simple link on reading and writing text files in Java:
If you want to “hide” the file, you can set it’s file attributes to “hidden”.
If you want to prevent people from reading the file, you must encrypt it: