The object contains a byte array. Converting an object containing a byte array to a byte array results in something other than the original byte array. You can verify that yourself by making a simple example of creating a byte array, serializing it, and then inspecting the contents of the memorystream (which will now be larger)