In my application I need to create large empty files (>50Mb) then fill them with data.
My problem is that I do not find any method for creating file with a specific size. My current solution is that I create a file something like this (it is just an example code):
conn = (FileConnection) Connector.open( "file:///"+aFilePath,
Then I open an outputStream to the file and I write empty data to it (just for example a basic code part):
byte zeros = new byte;
out = conn.openOutputStream();
// as many times as needed
But this solution is very slow if I have to create a large file. Is there any faster way?
Thank you frou your help!