I've been poking around the internet for quite a while now, and I was wondering how I could use BufferedReader and DataInputStream together without opening a different port. I've tried to stream images, but as the buffered reader stores extra bytes, it creates a corrupt image. When I attempt to use DataInputStream.read(), I can't read full lines of text as easily. Is there some sort of solution for my problem?

有帮助吗?

解决方案

DataInputStream.readLine(), and yes I know it's deprecated. The real solution is not to use lines in your protocol. Use readUTF() for example.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top