/*
Deserialize string. Make sure <code>null</code> is handled properly.
178546
private static String readString(DataInput reader) throws IOException {
		int blocks = reader.readUnsignedByte();
		int bitMask = blocks & 0xC0;
		if (bitMask == 0x40) {
			// Blocks are in 2 bytes.
			blocks = ((0x3F & blocks) << 8) | reader.readUnsignedByte();
		} else if (bitMask == 0x80) {
			// Blocks are in 3 bytes.
			blocks = ((0x3F & blocks) << 16) | (reader.readUnsignedByte() << 8) | reader.readUnsignedByte();
		} else if (bitMask == 0xC0) {
			// Blocks are in 4 bytes.
			blocks = ((0x3F & blocks) << 24) | (reader.readUnsignedByte() << 16) | (reader.readUnsignedByte() << 8) | reader.readUnsignedByte();
		}
		String result;
		if (blocks == 0) {
			result = null;
		} else if (blocks < 0) {
			throw new DeserializerException("Wrong 'null' indicator for a string", "0", Integer.toString(blocks));
		} else {
			StringBuilder sb = new StringBuilder();
			for (int i=0; i<blocks; i++) {
				sb.append(reader.readUTF());
			}
			result = sb.toString();
		}
		return result;
	}
867770
@SuppressWarnings("unchecked")
  public T deserialize() throws ClassNotFoundException {
    try {
      ByteArrayInputStream byteStream = new ByteArrayInputStream(data);
      GZIPInputStream gzipStream = new GZIPInputStream(byteStream);
      try {
        ObjectInputStream objectStream = new ObjectInputStream(gzipStream);
        object = (T) objectStream.readObject();
        return object;
      } finally {
        gzipStream.close();
      }
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
954161
@Override
    public <T> T deserialize(String body, TypeRef returnType) throws JsonMarshallingException {
        try {
            return deserializeChecked(body, returnType);
        } catch (Exception e) {
            throw new JsonMarshallingException(e);
        }
    }
438543
def _deserialize(self, value, attr, data):
        """"""
        value = super(SanitizedUnicode, self)._deserialize(value, attr, data)
        value = fix_text(value)

        # NOTE: This `join` might be ineffiecient... There's a solution with a
        # large compiled regex lying around, but needs a lot of tweaking.
        value = ''.join(filter(self.is_valid_xml_char, value))
        for char in self.UNWANTED_CHARACTERS:
            value = value.replace(char, '')
        return value
243881
private static Optional<Object> deserialize(InputStream input) throws IOException {
        try {
            BufferedInputStream bis = new BufferedInputStream(input);
            ObjectInputStream ois = new ObjectInputStream(bis);

            return Optional.of(ois.readObject());
        } catch (ClassNotFoundException ex) {
            LOG.log(Level.SEVERE, "An error occurred during deserialization an object.", ex);
        }
        return Optional.empty();
    }
1084673
function deserializeValue(value) {
  var num
  try {
    return value ?
      value == 'true' || value == true ||
      (value == 'false' || value == false ? false :
        value == 'null' ? null :
        !/^0/.test(value) && !isNaN(num = Number(value)) ? num :
        /^[\[\{]/.test(value) ? JSON.parse(value) :
        value)
      : value
  } catch (e) {
    return value
  }
}
1305919
public void parse(String string) {
    if (string == null) {
      throw new NullPointerException("string is null");
    }
    int bufferSize = Math.max(MIN_BUFFER_SIZE, Math.min(DEFAULT_BUFFER_SIZE, string.length()));
    try {
      parse(new StringReader(string), bufferSize);
    } catch (IOException exception) {
      // StringReader does not throw IOException
      throw new RuntimeException(exception);
    }
  }
30569
public static Object convertStringToObject(String string)
    {
        try {
            return ClassServiceUtility.getClassService().convertStringToObject(string, null);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e.getMessage());
        }
    }
1156647
static ReversePurgeLongHashMap deserializeFromStringArray(final String[] tokens) {
    final int ignore = STR_PREAMBLE_TOKENS;
    final int numActive = Integer.parseInt(tokens[ignore]);
    final int length = Integer.parseInt(tokens[ignore + 1]);
    final ReversePurgeLongHashMap hashMap = new ReversePurgeLongHashMap(length);
    int j = 2 + ignore;
    for (int i = 0; i < numActive; i++) {
      final long key = Long.parseLong(tokens[j++]);
      final long value = Long.parseLong(tokens[j++]);
      hashMap.adjustOrPutValue(key, value);
    }
    return hashMap;
  }
246900
public Object fromString(String str)
    {
        if (StringUtils.isNotBlank(str)) {
            ObjectMapper objectMapper = new ObjectMapper();

            try {
                return objectMapper.readValue(str, Object.class);
            } catch (Exception e) {
                LOGGER.info("Failed to parse JSON [{}]: ", StringUtils.abbreviate(str, 32),
                    ExceptionUtils.getRootCauseMessage(e));

                return null;
            }
        }

        return null;
    }
1131765
private Object convertStringToObject(String string)
    	throws ClassNotFoundException
    {
        if ((string == null) || (string.length() == 0))
            return null;
        try {
            InputStream reader = new ByteArrayInputStream(string.getBytes(BundleConstants.OBJECT_ENCODING));//Constants.STRING_ENCODING));
            ObjectInputStream inStream = new ObjectInputStream(reader);
            Object obj = inStream.readObject();
            reader.close();
            inStream.close();
            return obj;
        } catch (IOException ex)    {
            ex.printStackTrace();   // Never
        }
        return null;
    }
636152
@SuppressWarnings({ "unchecked", "rawtypes" })
    public static <T> T deserialize(Input in, Type target) {
        if (BLACK_LIST == null) {
            //log.info("Black list is not yet initialized");
            try {
                loadBlackList();
            } catch (IOException e) {
                throw new RuntimeException("Failed to init black-list");
            }
        }
        byte type = in.readDataType();
        if (log.isTraceEnabled()) {
            log.trace("Type: {} target: {}", type, (target != null ? target.toString() : "Target not specified"));
        } else if (log.isDebugEnabled()) {
            log.debug("Datatype: {}", DataTypes.toStringValue(type));
        }
        Object result = null;
        switch (type) {
            case DataTypes.CORE_NULL:
                result = in.readNull();
                break;
            case DataTypes.CORE_BOOLEAN:
                result = in.readBoolean();
                break;
            case DataTypes.CORE_NUMBER:
                result = in.readNumber();
                break;
            case DataTypes.CORE_STRING:
                try {
                    if (target != null && ((Class) target).isEnum()) {
                        log.warn("Enum target specified");
                        String name = in.readString();
                        result = Enum.valueOf((Class) target, name);
                    } else {
                        result = in.readString();
                    }
                } catch (RuntimeException e) {
                    log.error("failed to deserialize {}", target, e);
                    throw e;
                }
                break;
            case DataTypes.CORE_DATE:
                result = in.readDate();
                break;
            case DataTypes.CORE_ARRAY:
                result = in.readArray(target);
                break;
            case DataTypes.CORE_MAP:
                result = in.readMap();
                break;
            case DataTypes.CORE_XML:
                result = in.readXML();
                break;
            case DataTypes.CORE_OBJECT:
                result = in.readObject();
                break;
            case DataTypes.CORE_BYTEARRAY:
                result = in.readByteArray();
                break;
            case DataTypes.CORE_VECTOR_INT:
                result = in.readVectorInt();
                break;
            case DataTypes.CORE_VECTOR_UINT:
                result = in.readVectorUInt();
                break;
            case DataTypes.CORE_VECTOR_NUMBER:
                result = in.readVectorNumber();
                break;
            case DataTypes.CORE_VECTOR_OBJECT:
                result = in.readVectorObject();
                break;
            case DataTypes.OPT_REFERENCE:
                result = in.readReference();
                break;
            case DataTypes.CORE_END_OBJECT:
                // end-of-object returned, not sure that we should ever get here
                log.debug("End-of-object detected");
                break;
            default:
                result = in.readCustom();
                break;
        }
        return (T) result;
    }
987971
protected Object deserialize(byte[] in) {
    Object rv=null;
    ByteArrayInputStream bis = null;
    ObjectInputStream is = null;
    try {
      if(in != null) {
        bis=new ByteArrayInputStream(in);
        is=new ObjectInputStream(bis);
        rv=is.readObject();
        is.close();
        bis.close();
      }
    } catch (IOException e) {
      getLogger().warn("Caught IOException decoding %d bytes of data",
          in == null ? 0 : in.length, e);
    } catch (ClassNotFoundException e) {
      getLogger().warn("Caught CNFE decoding %d bytes of data",
          in == null ? 0 : in.length, e);
    } finally {
      CloseUtil.close(is);
      CloseUtil.close(bis);
    }
    return rv;
  }
1200117
public static Object deserialize(String json, TypeReference<?> typeReference) throws SerializationException {
		try {
			logger.debug("Json string to deserialize {} ", json);
			return mapper.readValue(json, typeReference);
		} catch (IOException e) {
			logger.error("SerializationException {}", e.getMessage());
			SerializationException serializationException = new SerializationException(e);
			throw serializationException;
		}
	}
1054990
@SuppressWarnings("Unchecked class type")
    @Override
    public <T> T deserialize(@Nullable ByteBuffer data) {
        if (data == null) {
            return null;
        }

        Object deserializedObject = columnDataType.deserialize(data, ProtocolVersion.NEWEST_SUPPORTED);

        return (T) deserializedObject;
    }
741804
protected Object deserialize(byte[] in) {
    Object rv = null;
    ByteArrayInputStream bis = null;
    ObjectInputStream is = null;
    try {
      if (in != null) {
        bis = new ByteArrayInputStream(in);
        is = new XmcObjectInputStream(bis);
        rv = is.readObject();

      }
    } catch (IOException e) {
      log.error("Caught IOException decoding " + in.length + " bytes of data", e);
    } catch (ClassNotFoundException e) {
      log.error("Caught CNFE decoding " + in.length + " bytes of data", e);
    } finally {
      if (is != null) {
        try {
          is.close();
        } catch (IOException e) {
          // ignore
        }
      }
      if (bis != null) {
        try {
          bis.close();
        } catch (IOException e) {
          // ignore
        }
      }
    }
    return rv;
  }
567429
public static HttpString tryFromString(String string) {
        HttpString cached = Headers.fromCache(string);
        if(cached != null) {
            return cached;
        }
        final int len = string.length();
        final byte[] bytes = new byte[len];
        for (int i = 0; i < len; i++) {
            char c = string.charAt(i);
            if (c > 0xff) {
                return null;
            }
            bytes[i] = (byte) c;
        }
        return new HttpString(bytes, string);
    }