>Indeed, there are negative numbers. This is pretty much how it works:
>
>object java = Java.pkg["my/java/class"]();
>object /* Java.jarray */ res = java->downloadDocument(some, params); //
>returns byte[]
>array(int) pike_array = values(res);
>
>String.Buffer b = String.Buffer();
>
>foreach (pike_array, int c)
> b->add(sprintf("%c", c);
Modify the above to
b->add(sprintf("%c", c & 255));
or just replace all of it with
string res = (string)map(pike_array, `&, 255);
>Stdio.write_file("test.pdf", b->get());
>
>And as I wrote before: The same problem occurs if I create a string from
>the byte array directly in Java and transfer the string to Pike.
That does seem a bit strange though. Marcus?
/grubba