public JsonValue parse (InputStream input) { try { return parse(new InputStreamReader(input, "UTF-8")); } catch (IOException ex) { throw new SerializationException(ex); } finally { StreamUtils.closeQuietly(input); } }
public JsonValue parse (InputStream input) { try { return parse(new InputStreamReader(input, "UTF-8")); } catch (IOException ex) { throw new SerializationException(ex); } finally { StreamUtils.closeQuietly(input); } }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Reader reader) { return (T)readValue(type, null, new JsonReader().parse(reader)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, String json) { return (T)readValue(type, elementType, new JsonReader().parse(json)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, InputStream input) { return (T)readValue(type, null, new JsonReader().parse(input)); }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, InputStream input) { return (T)readValue(type, elementType, new JsonReader().parse(input)); }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, Reader reader) { return (T)readValue(type, elementType, new JsonReader().parse(reader)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, char[] data, int offset, int length) { return (T)readValue(type, null, new JsonReader().parse(data, offset, length)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, String json) { return (T)readValue(type, null, new JsonReader().parse(json)); }
public JsonValue parse (FileHandle file) { try { return parse(file.reader("UTF-8")); } catch (Exception ex) { throw new SerializationException("Error parsing file: " + file, ex); } }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Reader reader) { return (T)readValue(type, null, new JsonReader().parse(reader)); }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, char[] data, int offset, int length) { return (T)readValue(type, elementType, new JsonReader().parse(data, offset, length)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, InputStream input) { return (T)readValue(type, null, new JsonReader().parse(input)); }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, InputStream input) { return (T)readValue(type, elementType, new JsonReader().parse(input)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, char[] data, int offset, int length) { return (T)readValue(type, null, new JsonReader().parse(data, offset, length)); }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, String json) { return (T)readValue(type, elementType, new JsonReader().parse(json)); }
void merge (Settings settings, File settingsFile) { try { json.readFields(settings, new JsonReader().parse(new FileReader(settingsFile))); } catch (Exception ex) { throw new GdxRuntimeException("Error reading settings file: " + settingsFile, ex); } }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, FileHandle file) { try { return (T)readValue(type, null, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }
/** @param type May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, FileHandle file) { try { return (T)readValue(type, null, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }
/** @param type May be null if the type is unknown. * @param elementType May be null if the type is unknown. * @return May be null. */ public <T> T fromJson (Class<T> type, Class elementType, FileHandle file) { try { return (T)readValue(type, elementType, new JsonReader().parse(file)); } catch (Exception ex) { throw new SerializationException("Error reading file: " + file, ex); } }