Java
renzhehongyi
这个作者很懒,什么都没留下…
展开
-
手机文件下载ClientAbortException: java.io.IOException: Connection reset by peer
问题java后台写了下载功能,电脑浏览器可以下载,可是手机下载报错ClientAbortExceptionjava.io.IOExceptionConnectionresetbypeer。解决将HttpStatus.CREATED改为HttpStatus.OK也就是200。原因下载的时候状态码设置为了HttpStatus.CREATED也就是201。...原创 2022-07-14 19:20:02 · 669 阅读 · 0 评论 -
spring mvc上传文件MultipartHttpServletRequest值为空
spring mvc上传文件MultipartHttpServletRequest值为空原创 2022-07-01 15:55:32 · 787 阅读 · 0 评论 -
JNI编程返回HashMap
[1].[代码]JniClient.java跳至[1][2][3][4]? 1 2 3 4 5 package com.ndk.test; import java.util.HashMap; public class JniClient { public static native HashMap<String, String> setMap(); } [2].[代...转载 2020-10-30 17:38:18 · 758 阅读 · 0 评论 -
java使用opencv读取文件路径有中文问题
if(isContainChinese(srcPic.getAbsolutePath())){ FileInputStream inputStream = new FileInputStream(srcPic); byte[] byt = new byte[(int) srcPic.length()]; int read = inputStream.read(byt); srcMat = Img...原创 2020-09-14 19:36:46 · 999 阅读 · 2 评论 -
JNI编程传递字节数组转换Mat对象
Java图像处理能力较差,需要调用openCV本地函数,为了减少IO次数,直接把直接流传递到本地函数中,然后使用imdecode转换成Mat对象Java代码import com.bcx.util.WebpJniUtil;import org.apache.commons.io.FileUtils;import org.apache.commons.io.IOUtils;import org.scijava.nativelib.DefaultJniExtractor;import org.s原创 2020-05-12 15:31:01 · 1350 阅读 · 2 评论 -
美解决doc、docx格式word转换为Html
由于项目需要,需要在线预览文档,所以就想转换为htmL格式; 此项目为maven项目,引入的包可能需要一些时间; maven项目转换为eclipse项目命令是:mvn eclipse:eclipse,然后导入到eclipse; jar引入完成后,绝对100%能运行;主要代码:package fxma.Word2Html;import java.io.Buffered原创 2015-09-27 17:02:39 · 22777 阅读 · 11 评论 -
DerInputStream.getLength(): lengthTag=111, too big.
问题:DerInputStream.getLength(): lengthTag=111, too big.原因:使用的公钥不是真正的公钥,而是我自己随便写的简单的字符串解决:使用真正的公钥解密byte[] keyBytes = EncryptUtil.rsaEncryptByPublicKey(desKey.getBytes(EncryptUtil.DEFAULT_CHARSET)...原创 2018-11-26 15:45:19 · 8175 阅读 · 0 评论 -
The request body did not contain the specified number of bytes
问题:安卓android使用HttpUtils上传图片直接连tomcat可以上传,经过nginx然后在转发到tomcat报错400通过使用抓包工具发现408错误:The request body did not contain the specified number of bytes. Got 32,592, expected 1,050,182。原因:content-length配置长...原创 2019-04-19 11:48:30 · 2440 阅读 · 0 评论 -
opencv unable to locate tools.jar Unable to find a javac compiler
问题:opencv编译make -j8报错 unable to locate tools.jar Unable to find a javac compilerunable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jarBuildfile:...原创 2019-07-03 19:20:01 · 368 阅读 · 0 评论