hanlp在jdk11 maven8编译后在jdk8 报错

 private static byte[] readBytesFromFileInputStream(FileInputStream fis) throws IOException
    {
        FileChannel channel = fis.getChannel();
        int fileSize = (int) channel.size();
        ByteBuffer byteBuffer = ByteBuffer.allocate(fileSize);
        channel.read(byteBuffer);
        ((Buffer) byteBuffer).flip();    //source    byteBuffer.flip(); 
        byte[] bytes = byteBuffer.array();
        ((Buffer) byteBuffer).clear();        //source    byteBuffer.clear(); 
        channel.close();
        fis.close();
        return bytes;
    }

hanlp.corpus.ioIOUtil.readBytesFromFileInputStream() 定位错误

借鉴:

https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip

原文地址:https://www.cnblogs.com/dhName/p/13462389.html