public static boolean write(List object, File file) {

		ObjectOutputStream output = null;

		try {
			output = new ObjectOutputStream(new FileOutputStream(file));
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}

		int amount = object.size();
		try {
			output.writeObject(amount);
		} catch (IOException e1) {
			e1.printStackTrace();
			return false;
		}

		if (object.isEmpty())
			return true;

		for (Object part : object) {
			try {
				output.writeObject(part);
			} catch (IOException e) {
				e.printStackTrace();
				return false;
			}
		}

		try {
			output.flush();
			output.close();
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}
		return true;

	}