⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.java

📁 This an example showing how idl helping to build the abstract class for the java objects. As a resul
💻 JAVA
字号:
import java.io.*;
import org.omg.CORBA.*;

public class Client{
	public static void main(String args[]){
		byte[] array;
		try{
			ORB orb = ORB.init(args, null);
			
			//Read IOR (stored in String format) from file
			BufferedReader in = new BufferedReader(new FileReader("ior"));
			String line = in.readLine();
			in.close();
			
			//convert IOR into object reference
			org.omg.CORBA.Object obj = orb.string_to_object(line);
			Data.FileAccess fileAccess = Data.FileAccessHelper.narrow(obj);
			
			//Invoke remote operations
			try{
				System.out.println("Reading the content of a file " + args[0] + " ... ");
				array = fileAccess.get(args[0]);
				for (int i = 0; i<array.length; i++)
					System.out.print((char)array[i]);
			}catch(Data.FileNotFound err) { System.out.println(err.err_msg); };
		}catch(Exception ex) {ex.printStackTrace();}		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -