Store data

This example show how to store the data stream of a file. The store() function automatically generate an new PrimaryDataEntityVersion for the PrimaryDataFile

...	
/* create new PrimaryDataFile */	
	
	PrimaryDataFile file = rootDirectory.createPrimaryDataFile("file");
	
	File inputFile = new File("text_file.txt");
	FileInputStream in = new FileInputStream(inputFile);
		
/* store data stream of "text_file.txt" to eDAL system implicitly, a new version of the PrimaryDataFile 'file' is created */
	
	file.store(in);
...

Read data

This example show how to read the data stream of a file.

...	
/* get PrimaryDataFile */
	
	PrimaryDataFile file = (PrimaryDataFile) rootDirectory.getPrimaryDataEntity("my_file.dat");
	
	File outputFile = new File("output_file.txt");
	FileOutputStream out = new FileOutputStream(outputFile);
		
/* read data stream of the latest version of PrimaryDataFile 'file' save data to "output_file.txt" */

	file.read(out);
...