Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top