protected void WriteSingleList(SubStream outstream, List <float> data)
 {
     outstream.WriteInt32(data.Count);
     foreach (float val in data)
     {
         outstream.WriteSingle(val);
     }
 }
 protected void WriteValue(SubStream outstream, object data)
 {
     if (data == null)
     {
         outstream.WriteByte((byte)'.');
     }
     else if (data is string)
     {
         outstream.WriteByte((byte)'s');
         outstream.WriteString((string)data);
     }
     else if (data is float)
     {
         outstream.WriteByte((byte)'f');
         outstream.WriteSingle((float)data);
     }
     else if (data is int)
     {
         outstream.WriteByte((byte)'i');
         outstream.WriteInt32((int)data);
     }
     else if (data is byte[])
     {
         outstream.WriteByte((byte)'R');
         WriteRawBinary(outstream, (byte[])data);
     }
     else if (data is List <string> )
     {
         outstream.WriteByte((byte)'S');
         WriteStringList(outstream, (List <string>)data);
     }
     else if (data is List <float> )
     {
         outstream.WriteByte((byte)'F');
         WriteSingleList(outstream, (List <float>)data);
     }
     else if (data is List <int> )
     {
         outstream.WriteByte((byte)'I');
         WriteInt32List(outstream, (List <int>)data);
     }
     else if (data is IList)
     {
         outstream.WriteByte((byte)'M');
         WriteList(outstream, (IList)data);
     }
     else if (data is IDictionary)
     {
         outstream.WriteByte((byte)'T');
         WriteKeyValuePairs(outstream, (IDictionary)data);
     }
     else
     {
         throw new InvalidOperationException(String.Format("Unable to write value of type {0}", data.GetType().ToString()));
     }
 }
 protected void WriteValue(SubStream outstream, object data)
 {
     if (data == null)
     {
         outstream.WriteByte((byte)'.');
     }
     else if (data is string)
     {
         outstream.WriteByte((byte)'s');
         outstream.WriteString((string)data);
     }
     else if (data is float)
     {
         outstream.WriteByte((byte)'f');
         outstream.WriteSingle((float)data);
     }
     else if (data is int)
     {
         outstream.WriteByte((byte)'i');
         outstream.WriteInt32((int)data);
     }
     else if (data is byte[])
     {
         outstream.WriteByte((byte)'R');
         WriteRawBinary(outstream, (byte[])data);
     }
     else if (data is List<string>)
     {
         outstream.WriteByte((byte)'S');
         WriteStringList(outstream, (List<string>)data);
     }
     else if (data is List<float>)
     {
         outstream.WriteByte((byte)'F');
         WriteSingleList(outstream, (List<float>)data);
     }
     else if (data is List<int>)
     {
         outstream.WriteByte((byte)'I');
         WriteInt32List(outstream, (List<int>)data);
     }
     else if (data is IList)
     {
         outstream.WriteByte((byte)'M');
         WriteList(outstream, (IList)data);
     }
     else if (data is IDictionary)
     {
         outstream.WriteByte((byte)'T');
         WriteKeyValuePairs(outstream, (IDictionary)data);
     }
     else
     {
         throw new InvalidOperationException(String.Format("Unable to write value of type {0}", data.GetType().ToString()));
     }
 }
 protected void WriteSingleList(SubStream outstream, List<float> data)
 {
     outstream.WriteInt32(data.Count);
     foreach (float val in data)
     {
         outstream.WriteSingle(val);
     }
 }