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

posted @ 2020-08-09 13:17  _Meditation  阅读(288)  评论(0编辑  收藏  举报