Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing a servlet's input stream from an Applet -- works on Windows/IE, doesn't on Mac/Safari



On Thu, 31 July 2003 12:33:38 -0400 Jim Solderitsch <email@hidden> wrote:

But now the applet is found but I cannot seem to get text off of the
input stream from the URL connection pointing to this servlet.

I encounter a similar problem when using java.nio.channels.SocketChannel. Sometimes the text is downloaded perfectly, other times it comes up missing. I've tried wrapping the connection stuff in an industrial-strength thread with wait/notifyAll so I don't process the text before it is downloaded and stored. No go, Joe.

My best guess so far is that something flaky is going on with StringBuffers under JDK 1.4.1.

What do you see if you print out your integers before appending them to your StringBuffer:

StringBuffer sb = new StringBuffer();
while (true) {
int i = in.read();
if (i < 0)
break;
System.out.println("I just read this integer: " + i);
sb.append((char) i);
}
?

- Craig
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.