11 2017 档案
springboot使用spring配置文件
摘要:1、如何在springboot中使用spring的配置文件,使用@Configuration和@ImportResource注解 package com.spring.task; import org.springframework.context.annotation.Configuration; 阅读全文
posted @ 2017-11-07 10:14 coder_ornot 阅读(200) 评论(0) 推荐(0)
Java TCP协议字节处理工具类
摘要:1、使用 tcp 协议 读取 输入流的固定长度的字节数 public static byte[] getTcpSpecificBytes(BufferedInputStream bis,int length) throws IOException{ byte[] bytes = new byte[l 阅读全文
posted @ 2017-11-01 13:59 coder_ornot 阅读(1844) 评论(0) 推荐(0)
java Int数据工具类
摘要:1、在使用tcp协议传输数据时,使用到的 Int 数据的工具类方法 //将 Int 数据转换成字节数组 public static byte[] intToByteArray(int data){ byte[] result = new byte[4]; result[0] = (byte)((da 阅读全文
posted @ 2017-11-01 13:49 coder_ornot 阅读(655) 评论(0) 推荐(0)
使用Apache common 的csv工具包处理csv文件
摘要:1、向csv文件中追加数据 //向文件中追加数据 BufferedWriter csvBufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(csvFile,true),Encoding),102 阅读全文
posted @ 2017-11-01 13:30 coder_ornot 阅读(2087) 评论(0) 推荐(0)