my question is pretty simple, I've an array of bytes (fullfilled via Sockets) and I would like transform it into a XmlTextReader object. How can I do this?
This doesn't work :
byte[] buffer = new byte[5000]; // TODO a revoir
int sizeReceived;
sizeReceived = _socket.Receive(buffer);
string s = Encoding.UTF8.GetString(buffer, 0, sizeReceived); // s is correctly fulfilled with XML a get back
MemoryStream memory = new MemoryStream(buffer);
memory.Position = 0;
return new XmlTextReader(memory);
Thanks for help.
Set start and end index of stream.
byte[] buffer = new byte[5000]; // TODO a revoir
int sizeReceived;
sizeReceived = _socket.Receive(buffer);
MemoryStream memory = new MemoryStream(buffer, 0, sizeReceived);
return new XmlTextReader(memory);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With