Code:
Process p = Runtime.getRuntime().exec("./rar.exe a -r -m5 -mm -md4096 -vn -y -v" + filesizeNew +"k "+rarFormat+" "+ sourceDirProper + "/"+verzeichnisName+"/*.*" );
byte[] suffer= new byte[4096];
try
{
while (true)
{
p.getInputStream().read(suffer);
}
}
catch (Exception e)
{
e.printStackTrace();
}
NOW rar.exe has 99 % cpu load while compressing there4 it compresses now very fine BUT, after the files are packed the java.exe has again 99 % cpu load and there are 2 java.exe files in the task manager both 80 and 20 MB in size why this??? Because of this high cpu load I canT nearly operate my whole computer!!!! ????
This is what someone advised me to do but I dont understand how to sort it!
This is probebly because you are in an infinate loop
while(true)
You need to have it break out once it is done compressing the file or there is not more input.
Aus dem englischen sun forum , war zu faul nochmals auf deutsch zu schreiben...
ich muss aus der endlosschleife rauskommen wenn das packen der daten fertig ist, wie überprüfe ich das?