Beispiel #1
0
 /// <exception cref="System.IO.IOException"/>
 public virtual double ReadDouble(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"double".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(double.ParseDouble(v.GetValue()));
 }
Beispiel #2
0
 /// <exception cref="System.IO.IOException"/>
 public virtual Buffer ReadBuffer(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"string".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(Utils.FromXMLBuffer(v.GetValue()));
 }
Beispiel #3
0
 /// <exception cref="System.IO.IOException"/>
 public virtual float ReadFloat(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"ex:float".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(float.ParseFloat(v.GetValue()));
 }
Beispiel #4
0
 /// <exception cref="System.IO.IOException"/>
 public virtual long ReadLong(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"ex:i8".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(long.Parse(v.GetValue()));
 }
Beispiel #5
0
 /// <exception cref="System.IO.IOException"/>
 public virtual int ReadInt(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"i4".Equals(v.GetType()) && !"int".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(System.Convert.ToInt32(v.GetValue()));
 }
Beispiel #6
0
 /// <exception cref="System.IO.IOException"/>
 public virtual bool ReadBool(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"boolean".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return("1".Equals(v.GetValue()));
 }
Beispiel #7
0
 /// <exception cref="System.IO.IOException"/>
 public virtual byte ReadByte(string tag)
 {
     XmlRecordInput.Value v = Next();
     if (!"ex:i1".Equals(v.GetType()))
     {
         throw new IOException("Error deserializing " + tag + ".");
     }
     return(byte.ParseByte(v.GetValue()));
 }