随笔分类 - 代码备份
摘要:/** * 发送请求报文 * 注:不可以关闭流 否则会关闭对应的socket */ public static void send(Socket socket, byte[] msg) { DataOutputStream out=null; try { out = new DataOutputStream((socket.getOutputStream())); out.write(msg); out.flush(); } catch (IOException e) { e.printStackTrace(); } } ...
阅读全文
摘要:/**向properties 中写入key=value*/ public static void writeProperties2(String filePath, String parameterName,String parameterValue) { Properties prop = new Properties(); InputStream fis = null; OutputStream fos =null; try { fis = new FileInputStream(filePath); prop.load(fis); fos= new FileOu...
阅读全文