I've got a 2 dimensional string array that I'm trying to serialize into a memorystream, and then read the memorystream using a binaryreader to get a bytearray.
The problem is that my byte array always ends up with nothing but 0's in it.
If I however, serialize to a filestream, it works alright.

Is there something obvious I've missed in my code?
(TileInfo is the 2-dimensional string array)
VB Code:
  1. Dim formatter As Runtime.Serialization.IFormatter = New Runtime.Serialization.Formatters.Binary.BinaryFormatter
  2.         Dim memStream As New IO.MemoryStream
  3.         formatter.Serialize(memStream, TileInfo)
  4.         Using bReader As New IO.BinaryReader(memStream)
  5.             Dim byteArray(CInt(bReader.BaseStream.Length)) As Byte
  6.             bReader.Read(byteArray, 0, CInt(bReader.BaseStream.Length))
  7.             BytesToSend.AddRange(byteArray)
  8.         End Using
  9.         memStream.Close()

Thanks.