|
From: <php...@li...> - 2009-12-03 13:28:56
|
Hi,
Thanks for you fast answer.
I try again to implement the Java Array class like that (from the FAQ):
$Byte = new JavaClass("java.lang.Byte");
$byte = $Byte->TYPE;
$Array = new JavaClass("java.lang.reflect.Array");
$byteArray = $Array->newInstance($byte, 8192);
$n;
while (($n = $data->read($byteArray)) > 0) {
$messageDigest->update($byteArray, 0, $n);
echo "n= " . $n ;
}
-> I always got a : Maximum execution time of 60 seconds exceeded in ...
When I try with a Php int Array like that:
$buf = array();
for ($i=0; $i<8192; $i++){
$buf[$i] = '0';
}
$n;
while (($n = $data->read($buf)) > 0) {
$messageDigest->update($buf, 0, $n);
echo "n= " . $n ;
}
-> I receive that: n= 184n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 8192n= 6259 Exception...
Here you can find the original Java code:
byte buf[] = new byte[8192];
int n;
while ((n = data.read(buf)) > 0) {
messageDigest.update(buf, 0, n);
System.out.print("n=" + n);
}
Do you see where the problem can come from?
Best regards Antoine
_________________________________________________________________
Faites vos achats de Noël en ligne en toute sécurité : avec MSN Internet Explorer 8 surfez sûr, télécharger maintenant gratuitement !
http://www.microsoft.ch/msnie8/fr
|