Hi, I'm kind of new to the world of streams in Java, and I was wondering - I have this Server/Client program, and I need to read Objects and Text streams. I tried making an ObjectInputStream, and a PrintWriter out of the Socket's InputStream, but when I tried to read from the stream, it said that I was reading the wrong type of data from the Stream. I need to pass the Strings through because it takes less time to send those than it does objects. I fixed it so it sends the String as an object, but I need it to send the string, because it is faster and my program is starting to lag.

If anyone knows of a solution to this problem, please let me know.

Recommended Answers

All 2 Replies

Please post a fragment of code and also paste a message you got from Socket's InputStream (Exception or Error).

never mind, I figured out what was wrong, thank you though =]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.