* @return the field in for from of a packet
* @throws ProtocolException
*/
public PacketField read(ByteBuffer buffer) throws ProtocolException {
Byte key = new Byte(buffer.get());
PacketFieldFactory factory = (PacketFieldFactory) factories.get(key);
if (factory == null) throw new ProtocolException("No factory registered for " + key);
return factory.create(buffer);
}