Skip to content

Instantly share code, notes, and snippets.

View maketubo's full-sized avatar

maketubo

  • guangzhou(出差)
View GitHub Profile
@maketubo
maketubo / cleaner
Last active September 8, 2020 15:55
My CleanerUtil Implementation
public class CleanerUtil {
private static MethodHandle methodHandle;
private static MethodHandle cleanerMethodHandle;
private static MethodHandle clean;
static {
MethodHandles.Lookup lookup = MethodHandles.publicLookup();
if (isJava9OrLater()) {
// Java 9 branch
@maketubo
maketubo / FindByte
Last active September 8, 2020 15:55
My FindByte Implementation
public class FindByte {
static Map<Byte, Long> map = new HashMap<>();
public static List<Integer> findAllPer8(byte find, byte[] target){
List<Integer> list = new ArrayList<>();
for(int i = 0; i < target.length; i = i + 8){
byte[] array;
if(target.length - i < 8){
array = Arrays.copyOfRange(target, i, target.length);