I don't know what is glassfish and neither I know what is 8.x.
What I think is happening is resp.getOutputStream() is somewhere using byte for its implementation because of which some characters are mixed up. It should be chars above 127. Try using an ASCII file (
ant .txt/.rtf file) and see whether it opens up. You can also try using a hex editior/comparator to see which chars are getting mixed up.
Didn't read the whole post clearly. Using a byte[] array might also be a problem. But I have no clue why it is working in one and not in the other case.
[ November 14, 2006: Message edited by: Anupam Sinha ]