   Reading from a MemoryStream
  Hello!Im trying to make a class from which its possible to read arbitrary types using a generic Read-function. This looks like that:generic<typename T>void Read(T% in){Type^ t = T::typeid;if(t->Equals(System::String::typeid)){in = (T)System::Text::Encoding::ASCII->GetString(m_content, m_readPoint, m_content->Length - m_readPoint);m_readPoint += ((String^)in)->Length + 1;}else{System::Runtime::Serialization::IFormatter^ fmt = gcnew System::Runtime::Serialization::Formatters::Binary::BinaryFormatter();array<unsigned char>^ buffer = gcnew array<unsigned char>(System::Runtime::InteropServices::Marshal::SizeOf(in));m_reader->Read(buffer, 0, buffer->Length);in = (T)fmt->Deserialize(gcnew System::IO::MemoryStream(buffer));m_readPoint += buffer->Length;}}There seems to be a problem with that. It works well if i read a System::String but the other types seem not to be right. Deserialize throws an exception that the end of the stream was reached. I found that for a UInt16 the Deserialisation tries to read 53 Bytes from the stream. Whats the reason for that?GreetingsPlerion   