DataInputStream di = new DataInputStream(new BufferedInputStream(in));
di.mark(3);
int version = di.readUnsignedShort();
di.reset();
Class<DeserializeWorker> workerClass = deserializeWorkers.get(version);
DeserializeWorker worker = workerClass.newInstance();
worker.setInputStream(di);
worker.setAliasRegistry(aliasRegistry);
worker.setProxyRegistry(proxyRegistry);
deserializer = new AMFMessageDeserializer(worker);
} catch (Exception e) {
LogWriter.error(getClass(), "Failed to create deserializer: " + e, e);
}