Gets the deserializer(s) for a specific type
@private
@memberOf Marshal
358752
function getDeserializer(type, subtype)
{
    if (Array.isArray(type))
        return compositeDeserializer(_.map(type, function(value) { return getDeserializer(value, subtype); }));

    return function deserializer(val)
    {
        return val !== null ? Deserializers[type](val, subtype) : null;
    };
}
1058402
private Object deserialize(TypeInfo type, Object rawValue)
            throws SerDeException {
        Object value = null;

        if (rawValue != null) {
            switch (type.getCategory()) {
                case PRIMITIVE:
                    value = deserializePrimitive((PrimitiveTypeInfo) type, rawValue);
                    break;
                case STRUCT:
                    value = deserializeStruct((StructTypeInfo) type, rawValue);
                    break;
                case MAP:
                    value = deserializeMap((MapTypeInfo) type, rawValue);
                    break;
                case LIST:
                    value = deserializeList((ListTypeInfo) type, rawValue);
                    break;
                case UNION:
                    value = deserializeUnion((UnionTypeInfo) type, rawValue);
                    break;
            }
        }

        return value;
    }
80062
function deserializeField (value, type, prefix) {
  if (!value) return ''
  switch (type) {
    case FIELD_TYPES.int:
      return readInt(value)
    case FIELD_TYPES.id:
      return readId(value)
    case FIELD_TYPES.ids:
      return value.map(readId)
    case FIELD_TYPES.bool:
      return value[0] === 1
    case FIELD_TYPES.binary:
      return encode(value, prefix)
    case FIELD_TYPES.string:
      return value.toString()
    case FIELD_TYPES.pointers:
      return readPointers(value)
    case FIELD_TYPES.rlpBinary:
      return unpackTx(value, true)
    case FIELD_TYPES.rlpBinaries:
      return value.map(v => unpackTx(v, true))
    case FIELD_TYPES.rawBinary:
      return value
    case FIELD_TYPES.hex:
      return value.toString('hex')
    case FIELD_TYPES.offChainUpdates:
      return value.map(v => unpackTx(v, true))
    case FIELD_TYPES.callStack:
      // TODO: fix this
      return [readInt(value)]
    case FIELD_TYPES.mptree:
      return value.map(mpt.deserialize)
    case FIELD_TYPES.callReturnType:
      switch (readInt(value)) {
        case '0': return 'ok'
        case '1': return 'error'
        case '2': return 'revert'
        default: return value
      }
    default:
      return value
  }
}
874452
private Serializer getSupportedSerializer(Object o) throws SerializerException {
        for (Serializer s : serializers) {
            if (s.canWrite(o)) {
                return s;
            }
        }
        throw new SerializerException("Unable to find serializer for object with type '" + o.getClass() + "'");
    }
1192786
def deserialize_iter(self, attr, iter_type):
        
        if attr is None:
            return None
        if isinstance(attr, ET.Element): # If I receive an element here, get the children
            attr = list(attr)
        if not isinstance(attr, (list, set)):
            raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(
                iter_type,
                type(attr)
            ))
        return [self.deserialize_data(a, iter_type) for a in attr]
739411
function __deserializeArray(buffer, start, options) {
	let dataView = new DataView(buffer);
	let length = dataView.getUint32(start, true);
	start += 4;
	let end = start + length;
	let data = [];
	while (start < end) {
		let subType, subData;
		({ anchor: start, value: subType } = __deserializeType(buffer, start, options));
		({ anchor: start, value: subData } = __deserializeData(subType, buffer, start, options));
		data.push(subData);
	}
	return { anchor: end, value: data };
}
761507
function compositeDeserializer(deserializers){
  return function(str){
    var buf = new Buffer(str, 'binary'),
        pos = 0, len, vals = [], i = 0;

     while( pos < buf.length){
       len = buf.readUInt16BE(pos);
       pos += 2;
       vals.push(deserializers[i](buf.slice(pos, len + pos)));
       i += 1;
       pos += len + 1;
     }

    return vals;
  };
}
860124
def deserialize(klass, data):
    
    handler = DESERIALIZE_REGISTRY.get(klass)
    if handler:
        return handler(data)
    raise TypeError("There is no deserializer registered to handle "
                    "instances of '{}'".format(klass.__name__))
495278
def _get_serializer(self, _type):
        
        if _type in _serializers:  # _serializers is module level
            return _serializers[_type]
        # array and object are special types
        elif _type == 'array':
            return self._get_array_serializer()
        elif _type == 'object':
            return self._get_object_serializer()

        raise ValueError('Unknown type: {}'.format(_type))
30198
private Object deserialize() {
    SerializingTranscoder tc = new SerializingTranscoder();
    CachedData d = new CachedData(this.getItemFlags(), this.getValue(),
      CachedData.MAX_SIZE);
    Object rv = null;
    rv = tc.decode(d);
    return rv;
  }
1148807
def get_deserializer(serializer_format):
    
    if serializer_format == Format.JSON:
        return _deserialize_json
    if serializer_format == Format.PICKLE:
        return _deserialize_pickle
1032118
function parseTypeString(type){
  if (type.indexOf('CompositeType') > -1){
    return getCompositeTypes(type);
  } else if(type.indexOf('ReversedType') > -1){
    return getType(getInnerType(type));
  }
  else if(type.indexOf('org.apache.cassandra.db.marshal.SetType') > -1){
    return getSetType(type);
  }
  else if(type.indexOf('org.apache.cassandra.db.marshal.ListType') > -1){
    return getListType(type);
  }
  else if(type.indexOf('org.apache.cassandra.db.marshal.MapType') > -1){
    return getMapType(type);
  }
  else if(type === null || type === undefined) {
    return 'BytesType';
  } else {
    return getType(type);
  }
}
751090
private <T extends Serializable> Serializer getSerializer(QName xmlType, Class<T> clazz)
      throws SecurityException,
      NoSuchMethodException,
      IllegalArgumentException,
      IllegalAccessException,
      InvocationTargetException {
    Method getSerializer = clazz.getMethod("getSerializer", String.class, Class.class, QName.class);
    return (Serializer) getSerializer.invoke(null, null, clazz, xmlType);
  }
47288
def _deserialize(x, elementType, compress, relicReadBinFunc):
    
    # Convert the bytearray into an appropriately sized ctypes array of bytes
    b = (c_ubyte*len(x))(*bytearray(x))

    # The compression flag is an integer.
    flag = c_int(compress)

    # Deserialize using the read function.
    result = elementType()
    relicReadBinFunc(byref(result), byref(b), len(x), flag)
    return result
7067
function deserializeInnerMessage(spec, message, buffer, bufferOffset) {
  spec.fields.forEach(function(field) {
    var fieldValue = message[field.name];

    if (field.isArray) {
      var array     = [];
      var arrayType = field.baseType;

      var arraySize;
      if (field.arrayLen !== null) {
        arraySize = field.arrayLen;
      } else {
        arraySize = buffer.readUInt32LE(bufferOffset[0]);
        bufferOffset[0] += 4; // only for variable length arrays
      }

      let ArrayMsgClass;
      let isPrimitive = field.isBuiltin;
      if (!isPrimitive) {
        ArrayMsgClass = getMessageFromRegistry(arrayType, 'msg');
      }

      for (var i = 0; i < arraySize; i++) {
        if (isPrimitive) {
          var value = fieldsUtil.deserializePrimitive(
            arrayType, buffer, bufferOffset);
          array.push(value);
        }
        else { // is message
          var arrayMessage = new ArrayMsgClass();

          arrayMessage = deserializeInnerMessage(spec.getMsgSpecForType(arrayType),
            arrayMessage, buffer, bufferOffset);

          array.push(arrayMessage);
        }
      }
      fieldValue = array;
    }
    else if (field.isBuiltin) {
      fieldValue = fieldsUtil.deserializePrimitive(
        field.type, buffer, bufferOffset)
    }
    else { // is message
      var innerMessage = new getMessageFromRegistry(field.baseType, 'msg')();
      fieldValue = deserializeInnerMessage(spec.getMsgSpecForType(field.baseType),
        innerMessage, buffer, bufferOffset);
    }

    message[field.name] = fieldValue;
  });

  return message;
}
303680
def deserialize(raw)
      begin
        case @serializer
        when :marshal
          Marshal.load(raw)
        when :json
          JSON.parse(raw, :create_additions => true)
        when :yaml
          YAML.load(raw)
        end
      rescue => e
        PEROBS.log.fatal "Cannot de-serialize object with #{@serializer} " +
          "parser: " + e.message
      end
    end
388740
function deserializeParameter(server, name, value, schema) {
    if (!schema) return value;

    const type = schemaType(schema);
    if (!type) server.log('req-params', 'Indeterminate schema type for parameter ' + name, schema);

    if (type === 'array') {
        const format = schema.hasOwnProperty('collectionFormat') ? schema.collectionFormat : 'csv';
        const delimiter = format === 'csv' ? ','
            : format === 'ssv' ? ' '
                : format === 'tsv' ? '\t'
                    : format === 'pipes' ? '|' : ',';
        value = value.split(delimiter);
        if (!schema.items) return value;
        return value.map(item => {
            return deserializeParameter(server, 'items for ' + name, item, schema.items);
        });

    } else if (type === 'boolean') {
        return !(value === 'false' || value === 'null' || value === '0' || value === '');

    } else if (type === 'integer' && rxInteger.test(value)) {
        return parseInt(value);

    } else if (type === 'number' && rxNumber.test(value)) {
        return parseFloat(value);

    } else {
        return value;
    }
}