数据量大分分片加密

数据量大分分片加密

                        List<HashMap<String, Object>> reportlist = reportlist();

            int chunkSize = 50000;
 for (int i = 0; i < reportlist.size(); i += chunkSize) {
 List<HashMap<String, Object>> subList = reportlist.subList(i, toIndex);
 				String reportDataStr = JSON.toJSONString(subList);
 				String encrypt = Sm4Util2.encryptSm4(reportDataStr);
                datafileWriterN.write(encrypt );
                datafileWriterN.flush();
                datafileWriterN.close();
 }

你可能感兴趣的:(Java,java)