297298299300301302303304305306307
{ return Type.VOID; } Class klass = value.getClass(); Type type = resolve(klass); if (type == null) { throw new IllegalArgumentException ("unable to resolve type: " + klass + ", " + value);
312313314315316317318319320321322
} } static final Type resolve(Class klass) { Type type = ENCODINGS.get(klass); if (type != null) { return type; }
358359360361362363364365366367368
{ for (Map.Entry<String,Object> entry : map.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); Type type = encoding(value); writeStr8(key); put(type.code); write(type, value); } }
380381382383384385386387388389
protected void writeListEntries(List<Object> list) { for (Object value : list) { Type type = encoding(value); put(type.code); write(type, value); } }
398399400401402403404405406407408
endSize32(pos); } protected void writeArrayEntries(List<Object> array) { Type type; if (array.isEmpty()) { return; }
282283284285286287288289290291292
Map<String,Object> result = new LinkedHashMap(); for (int i = 0; i < count; i++) { String key = readStr8(); byte code = get(); Type t = getType(code); Object value = read(t); result.put(key, value); } return result;
310311312313314315316317318319320
List<Object> result = new ArrayList(); for (int i = 0; i < count; i++) { byte code = get(); Type t = getType(code); Object value = read(t); result.add(value); } return result; }
327328329330331332333334335336337
{ return null; } byte code = get(); Type t = getType(code); long count = readUint32(); if (count == 0) { return Collections.EMPTY_LIST;
346347348349350351352353354355356
return result; } private Type getType(byte code) { Type type = Type.get(code); if (type == null) { throw new IllegalArgumentException("unknown code: " + code); } else
296297298299300301302303304305306