Losing 1/2 my data in System.Collections.Queues ..
-
Hi, I have a byte array of data that I store in to a Queue for processing reasons. But for some strange reason half of the data I put in the Queue (exactly the last half, actually, everytime!) dequeue as nulls (0x00). The sample output below shows the problem I'm having. The first two lines are a hex dump of my "input" byte array. The next line, "CreateQueue() done" tells me that the Queue was create and has the same size as the byte array (as it should). But in my double check you can see how the last 16 bytes are all null. Anybody know what's going on? Thx, Matt ----------------------------------------------------------------- 0000: ad 00 14 00 04 02 00 00 0a 4f 70 65 6e 53 65 72 0010: 76 65 72 05 00 00 00 fd 00 00 00 00 00 00 00 00 CreateQueue() done. matt=32, queue count=32 double check: 0000: ad 00 14 00 04 02 00 00 0a 4f 70 65 6e 53 65 72 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Here's the code that populates the Queue from the byte array: foreach(byte b in Pdu.Payload) { m_qPayload.Enqueue((byte)b); }