Skip to content

Instantly share code, notes, and snippets.

@eggie5
Created August 12, 2011 00:07
Show Gist options
  • Save eggie5/1141123 to your computer and use it in GitHub Desktop.
Save eggie5/1141123 to your computer and use it in GitHub Desktop.
json_deserializer.java
Hashtable<String, List<Float>> buffers=new Hashtable<String, List<Float>>();
// load file
JsonFactory sJsonFactory = new JsonFactory();
JsonParser p = sJsonFactory.createJsonParser(model_io_stream);
List<Float> buffer;
p.nextToken();
while (p.nextToken() != JsonToken.END_OBJECT)
{
String key = p.getCurrentName();
DebugLog.LOGD("key: " + key);
p.nextToken();
// found vertices:
// now find array start
buffer=new ArrayList<Float>();
while (p.nextToken() != JsonToken.END_ARRAY)
{
buffer.add(p.getFloatValue());
}
buffers.put(key, buffer);
}
p.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment