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