求助: Socket的InputStream和OutputStream的問題

nyquist發表於2006-04-04
小弟遇到一個問題:

class MyRunnable implements java.lang.Runnable{
	public java.net.Socket __sc;
	public java.io.InputStream __is;
	public java.io.OutputStream __os;
	public java.io.ObjectInputStream __ois;
	public java.io.ObjectOutputStream __oos;
	
	public MyRunnable(Socket sc) throws IOException{
		
		__sc = sc;
		__is = __sc.getInputStream();
		__os = __sc.getOutputStream();	
		System.out.println("__is and __os getted");
		__ois = new ObjectInputStream(__is);
		__oos = new ObjectOutputStream(__oos);
		System.out.println("__ois and __oos getted");
	}
}
<p class="indent">

上面的程式碼有什麼問題?為什麼得不到ObjectInputStream和ObjectOutputStream?
如果各位大大知道答案,請告訴小弟,感激不盡

相關文章