主要代码部分
File f = new File("D:\\data.txt"); RandomAccessFile file = new RandomAccessFile(file, "r"); byte[] buf = new byte[(int)f.length()]; file.read(buf); Socket socket = ...; socket.getOutputStream().write(buf);
内部工作流程图解
京公网安备 11010502049817号