} else if (type == ElementType.TYPE_DOUBLE_WRAPPER) {
document.put(key,valueList.getNextDouble());
} else if (type == ElementType.TYPE_LONG_WRAPPER) {
document.put(key,valueList.getNextLong());
} else if (type == ElementType.TYPE_EMBEDDED) {
ValueList tempList = valueList.getNextList();
Document nestedDoc = new Document();
read(nestedDoc,tempList,eType.nestedType);
document.put(key,nestedDoc);
} else if (type == ElementType.TYPE_EMBEDDED_ARRAY) {
//} TODO else if (type == DocumentType.TYPE_REFERENCE_ARRAY) {
ValueList tempList = valueList.getNextList();
if (tempList == null) {
document.put(key,null);
continue;
}
int listLen = tempList.length();
Document[] references = new Document[listLen];
for (int j=0;j<listLen;j++) {
references[j] = new Document();
ValueList tList = tempList.getNextList();
read(references[j],tList,eType.nestedType);
}
document.put(key,references);
} else if (type == ElementType.TYPE_REFERENCE) {
String address = valueList.getNextString();