M
Matt
I just wanted to know if I am converting to/from streams the easiest and
correct way. I am performing the following statements to convert byte
arrays to and from streams during different processing in my application:
Here is a sample where I convert from a stream to a byte array:
strm = mqMsg.BodyStream;
BinaryReader br = new BinaryReader(strm);
byteArray= br.ReadBytes(Convert.ToInt32(strm.Length));
Here is a sample where I convert from a byte array to a stream:
MemoryStream memStream = new MemoryStream();
BinaryWriter binWriter = new BinaryWriter(memStream);
binWriter.Write(byteArray);
Thanks,
Matt
correct way. I am performing the following statements to convert byte
arrays to and from streams during different processing in my application:
Here is a sample where I convert from a stream to a byte array:
strm = mqMsg.BodyStream;
BinaryReader br = new BinaryReader(strm);
byteArray= br.ReadBytes(Convert.ToInt32(strm.Length));
Here is a sample where I convert from a byte array to a stream:
MemoryStream memStream = new MemoryStream();
BinaryWriter binWriter = new BinaryWriter(memStream);
binWriter.Write(byteArray);
Thanks,
Matt