public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     BsonType bsonType = bsonReader.PeekBsonType();
     byte value;
     if (bsonType == BsonType.Int32) {
         value = (byte) bsonReader.ReadInt32(propertyMap.ElementName);
     } else if (bsonType == BsonType.Document) {
         bsonReader.ReadDocumentName(propertyMap.ElementName);
         bsonReader.ReadStartDocument();
         bsonReader.VerifyString("_t", typeof(byte).FullName);
         value = (byte) bsonReader.ReadInt32("v");
         bsonReader.ReadEndDocument();
     } else {
         throw new FileFormatException("Element is not valid System.Byte");
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonInt32 value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         value = BsonInt32.Create(bsonReader.ReadInt32(propertyMap.ElementName));
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var value = bsonReader.ReadInt32(propertyMap.ElementName);
     propertyMap.Setter(obj, value);
 }