Here you can find the source of splitString(String hexString, int partSize)
public static List<String> splitString(String hexString, int partSize)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> splitString(String hexString, int partSize) { //Splits a String into pieces of length partSize List<String> parts = new ArrayList<>(); int length = hexString.length(); for (int i = 0; i < length; i += partSize) { parts.add(hexString.substring(i, Math.min(length, i + partSize))); }/*from w w w. j av a2 s.c o m*/ return parts; } }