Exemplo n.º 1
0
 private object InternalReadValue(Type type)
 {
     if (type == typeof(string))
     {
         return(this.m_reader.ReadString());
     }
     if (type == typeof(string[]))
     {
         return(MessageUtil.ReadStringArray(this.m_reader));
     }
     if (type == typeof(bool))
     {
         return(this.m_reader.ReadBoolean());
     }
     if (type == typeof(int))
     {
         return(this.m_reader.ReadInt32());
     }
     if (type == typeof(Stream))
     {
         this.m_lastStream = new LengthEncodedReadableStream(this.m_reader);
         return(this.m_lastStream);
     }
     if (type == typeof(Dictionary <string, object>))
     {
         return(this.ReadDictionary());
     }
     throw new NotImplementedException();
 }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (this.m_lastStream != null)
     {
         this.m_lastStream.Dispose();
         this.m_lastStream = null;
     }
 }
Exemplo n.º 3
0
 private void VerifyLastStream()
 {
     if (this.m_lastStream == null)
     {
         return;
     }
     if (this.m_lastStream.Closed)
     {
         this.m_lastStream = null;
         return;
     }
     throw new InvalidOperationException("last stream");
 }