- } else if (line.startsWith("REF ")) { // REF: create/link self
- String ref = line.substring(4).split("@")[1];
+ }
+
+ // Custom objects
+ if (CustomSerializer.isCustom(in)) {
+ // not a field value but a direct value
+ String line = IOUtils.readSmallStream(in);
+ me = SerialUtils.decode(line);
+ return false;
+ }
+
+ // TODO use the stream, Luke
+ // .. at least for REF
+ String line = IOUtils.readSmallStream(in);
+
+ if (line.startsWith("REF ")) { // REF: create/link self
+ // TODO: here, line is REF type@999:xxx
+ // xxx is optional
+ // note: use .end() when containsKey(ref)
+ String[] tab = line.substring("REF ".length()).split("@");
+ String type = tab[0];
+ tab = tab[1].split(":");
+ String ref = tab[0];
+