Class CleanUtil


  • public class CleanUtil
    extends Object
    A Helper class which use reflections to clean up DirectBuffer. It's implemented for better compatibility with both java8 and java9+, because the Cleaner class is moved to another place since java9+. Strongly inspired by: https://github.com/apache/tomcat/blob/master/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
    • Method Detail

      • cleanDirectBuffer

        public static void cleanDirectBuffer​(ByteBuffer buf)