public static FileDescriptor forTuple(Tuple tup) {
		if (!tup.isOfTypes(byte[].class, Integer.class, Long.class))
			throw new IllegalArgumentException(
					"Invalid Tuple passed to FileDescriptor.forTuple()!");
		String id = new String((byte[]) tup.getItem(0));
		int owner = (int) tup.getItem(1);
		
		long size = -1L;
		Object o = tup.getItem(2);
		if (o instanceof Long)
			size = ((Long) o).longValue();
		else if (o instanceof Integer)
			size = (long) ((Integer) o).intValue();
		else if (o instanceof Short)
			size = (long) ((Short) o).shortValue();
		else if (o instanceof Byte)
			size = (long) ((Byte) o).byteValue();
		
		return new FileDescriptor(id, owner, size);
	}