0
我有一个客户端服务器程序,我需要序列化文件对象并将其发送给客户端。文件对象序列化
在服务器端:
FileInputStream input_file = new FileInputStream(file);
object_output_stream.writeObject(input_file);
在客户端:
FileOutputStream ouput_file = new FileOutputStream(new File(filename));
output_file = object_input_stream.readObject();
我需要序列化INPUT_FILE对象,并将其发送给客户端。 ObjectOutputStream和ObjectInputStream是不可序列化的。最好的办法是什么?