@Override
	public EntityMetadata deserialize(DataInputStream is) throws IOException {
		
		EntityMetadata metaData = new EntityMetadata();
		int keyAndType = is.readUnsignedByte();

		while (keyAndType != 127) {
			
			int index    = keyAndType & 0x1f;
			int type     = keyAndType >> 5;
			Object value = null;
			
			switch (type) {
				
				case 0:
					value = is.readByte();
					break;
					
				case 1:
					value = is.readShort();
					break;
					
				case 2:
					value = is.readInt();
					break;
					
				case 3:
					value = is.readFloat();
					break;
					
				case 4:
					value = new StringSerializer().deserialize(is);
					break;
					
				case 5:
					value = new SlotDataSerializer().deserialize(is);
					break;
					
				case 6:
					List<Integer> list = new LinkedList<>();
					list.add(is.readInt());
					list.add(is.readInt());
					list.add(is.readInt());
					value = list;
					break;
			}

			if (value != null) {
				metaData.add(index, value);
			}
			
			// read next
			keyAndType = is.readUnsignedByte();
		}
		
		return metaData;
	}