Unknown data size - Socket proggramming
Hello,
How can I use an unknown buffer size to store bytes which sended through a socket? [the buffer will fit itself according to the length of the data]
Currently, I am using a big byte array, but a lot of memory is wasted because most of the time there is no need for such a big buffer
Re: Unknown data size - Socket proggramming
You can send the data in chunks and on the client use ArrayList or some other collection to build the complete buffer. I was also using StringBuilder in a couple of situations.
Re: Unknown data size - Socket proggramming