with the help of an expert here, i currently have the following:
File f = new File(inputFileName);
Scanner in = new Scanner(f);
String input = in.useDelimiter("\\Z").next();
However, if the file(all text inside) is too huge, my String object will only store from middle onwards till end of file? Any sugggestion? My that file size is around 3,000KB.
And also, how much char can a String store?So i know what file size and above will cuz my prog to crash
Thanks
Update: guys i realized the problem might not be my String is unable to store all the chars in the file but rather it is taking a very long time to process my compression hence. I am still debugging, will update as soon as i am very sure of the issue. Any guys know if substring will caused my prog to be very slow? As i dont thing there are any big issue with my algorithm