1.实现客户端向服务器端发送文件,服务器向客户端返回 “接收成功信息” 在客户端打印输出。
客户端
public static void main(String[] args) throws IOException {
//发送文件
//客户端创建一个要发送的新文件
File file = new File("E:\\demo.txt");
Socket s = new Socket("127.0.0.1", 9999);
//客户端向服务器发送
OutputStream os = s.getOutputStream();
FileInputStream fis = new FileInputStream(file);
byte[] b