public static function read_field($fp, $wire_type, &$limit = null) {
		switch ($wire_type) {
			case 0: // varint
				return Protobuf::read_varint($fp, $limit);

			case 1: // 64bit
				$limit -= 8;
				return fread($fp, 8);

			case 2: // length delimited
				$len = Protobuf::read_varint($fp, $limit);
				$limit -= $len;
				return fread($fp, $len);

			//case 3: // Start group TODO we must keep looping until we find the closing end grou

			//case 4: // End group - We should never skip a end group!
			//	return 0; // Do nothing

			case 5: // 32bit
				$limit -= 4;
				return fread($fp, 4);

			default:
				throw new Exception('read_unknown('. ProtoBuf::get_wiretype($wire_type) . '): Unsupported wire_type');
		}
	}