public class Structure implements Serializable{
byte[] msg;
byte[] digest;
public Structure(byte[] m,byte[] k){
msg = m;
digest = k;
}
}
public void structureWrite(Structure data) throws IOException,InvalidClassException,NotSerializableException{//对象写入生成字节数组

FileOutputStream baos = new FileOutputStream("nihao.dat") ;
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(data);
}
Structure senddata = new Structure(outBuf,Temdata);//outBuf,Temdata是两个字节数组。
为什么oos.writeObject(data);这句要抛出IO异常???如果对象是系统自带类的,不是自己定义的类对象的话,就不会抛出异常