串行化问题,急问,在线等

styfwz 2004-09-14 04:30:27
class CServerLink
{
private int nPort;

public static Socket soc;
public static InputStream sin;
public static OutputStream sout;
public static InputStream cryptin;
public static OutputStream cryptout;
public static ObjectInputStream ois;
public static ObjectOutputStream oos;

public CServerLink(int np)
{
nPort = np;
}

public void getLinked()
{
try
{
byte[] desKeyData = {(byte)12, (byte)251, (byte)53, (byte)63, (byte)98, (byte)93, (byte)12, (byte)45};
SecretKey privateLib = new SecretKeySpec(desKeyData, "DES");
Cipher cip = Cipher.getInstance("DES");
Cipher cipd = Cipher.getInstance("DES");
cip.init(Cipher.ENCRYPT_MODE, privateLib);
cipd.init(Cipher.DECRYPT_MODE, privateLib);

soc = server.svrsoc.accept();
System.err.println("get Linked");
sin = soc.getInputStream();
sout = soc.getOutputStream();
cryptin = new CipherInputStream(sin, cipd);
cryptout = new CipherOutputStream(sout, cip);
ois = new ObjectInputStream(cryptin);
oos = new ObjectOutputStream(cryptout);
System.err.println("Here is arrived!");
}
catch(Exception e){};
}
}
语法上编译通过,但是运行到ois = new ObjectInputStream(cryptin);oos = new ObjectOutputStream(cryptout);时候卡住了。
哪为帮我一下。
...全文
65 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧