Able to send images over socket but not text files

后端 未结 1 521
有刺的猬
有刺的猬 2021-01-17 05:51

My client can send Images normally to server, but when it comes to text files they arrive empty. Any ideas what am I doing wrong? I\'d really appreciate help, because I have

相关标签:
1条回答
  • 2021-01-17 06:16
    1. You are prematurely closing BufferedReader on server side before reading all the data. This essentially closes the connection.
    2. You should not use Reader or Writer for non-character streams like binary image data. And you should not mix BufferedReader with any other stream wrapper for the same stream since it may read as many data as it fills in buffer.
    0 讨论(0)
提交回复
热议问题