// Reads NetworkStream into a byte buffer.
NetworkStream ns;
System.Net.Sockets.TcpClient client = new TcpClient();
byte[] receiveBytes = new byte[client.ReceiveBufferSize];
ns.Read(receiveBytes, 0, (int)client.ReceiveBufferSize);
String returndata = Encoding.UTF8.GetString(receiveBytes);
I am successfully reading from a client and storing the result into a string called returndata. However, when I try to concatenate returndata with anything, no concatenation occurs. Ex: String.Concat(returndata, "test") returns returndata, as does returndata + "test".
Does anyone know why this is happening?
Edit: Steve W is correct; i found out later that returndata.Length was always returning 8192.