for (EncodingKey key : EncodingKey.values())
eMap.put(key, NullEncoding.toParam());
for (int i = 0; i < mapSize; i++) {
String key = new String(new byte[] { buf.get(), buf.get() });
EncodingKey eKey = EncodingKey.byFirstTwoChars(key);
if (eKey == null)
throw new RuntimeException("Unknown encoding key: " + key);
EncodingID id = EncodingID.values()[buf.get()];
int paramLen = ByteBufferUtils.readUnsignedITF8(buf);
byte[] paramBytes = new byte[paramLen];
buf.get(paramBytes);
eMap.put(eKey, new EncodingParams(id, paramBytes));
log.debug(String.format("FOUND ENCODING: %s, %s, %s.",
eKey.name(), id.name(),
Arrays.toString(Arrays.copyOf(paramBytes, 20))));
}
}
{ // tag encoding map: