Good question,
I tried to figure out as well what these "dataURI" actually are and what looks to be happening is that
when you save something with save() it just appears as popup (or download for browser, depending on the type of file):
Eg. if you run this example (from the PJS page):
- int x = 0;
- void draw()
- {
- background(204);
- if(x < 100) {
- line(x, 0, x, 100);
- x = x + 1;
- } else {
- noLoop();
- }
- // Saves each frame as screen-0000.tif, screen-0001.tif, etc.
- saveFrame();
- }
You'll get popups:
Also looks like "dataURI" is just fancy word for encoding your data as string of charcters which would look like this:
data:image/gif;base64,R0lGOD lhCwAOAMQfAP////7+/vj4+Hh4eHd3d/v7+/Dw8HV1dfLy8ubm5vX19e3t7fr 6+nl5edra2nZ2dnx8fMHBwYODg/b29np6eujo6JGRkeHh4eTk5LCwsN3d3dfX 13Jycp2dnevr6////yH5BAEAAB8ALAAAAAALAA4AAAVq4NFw1DNAX/o9imAsB tKpxKRd1+YEWUoIiUoiEWEAApIDMLGoRCyWiKThenkwDgeGMiggDLEXQkDoTh CKNLpQDgjeAsY7MHgECgx8YR8oHwNHfwADBACGh4EDA4iGAYAEBAcQIg0Dk gcEIQA7
...
And later you can embed those characters in the webpage, eg. in IMG tag.
<img width="11" height="14" src="data:image/gif;base64,R0lGOD lhCwAOAMQfAP////7+/vj4+Hh4eHd3d/v7+/Dw8HV1dfLy8ubm5vX19e3t7fr 6+nl5edra2nZ2dnx8fMHBwYODg/b29np6eujo6JGRkeHh4eTk5LCwsN3d3dfX 13Jycp2dnevr6////yH5BAEAAB8ALAAAAAALAA4AAAVq4NFw1DNAX/o9imAsB tKpxKRd1+YEWUoIiUoiEWEAApIDMLGoRCyWiKThenkwDgeGMiggDLEXQkDoTh CKNLpQDgjeAsY7MHgECgx8YR8oHwNHfwADBACGh4EDA4iGAYAEBAcQIg0Dk gcEIQA7" alt="File Icon">
Check the link below, click the links in the the "URI" column. You can see that different strings (depending on the mime-type specified) can either be opened as webpage, image or can be downloaded as downloads).
Also this website seems to be able to give more or less decent description of what dataURI is: (and also offers online tool to convert your files into dataURI)
As I said in the beginning, the default operation in ProcessingJS when calling save() (with image file type) seems to be just opening the image file in new window (popup). Maybe when you save .txt file it will just download it.
But the bottom line is: JavaScript is not Java. Java was designed to have access to your filesystem and operate on your local files. JavaScript is not allowed to read/write files on your computer directly. Thus i guess dataURI is the best you can get.