public String uploadBook(MultipartFile file, Book book, HttpServletRequest request) {
try{
String lineTxt = null;
String content="";
List titlelist=new ArrayList();
InputStream inputStream = null;//获得字节流
if(!file.isEmpty()){
InputStreamReader inputStreamReader=null;
String url = request.getSession().getServletContext().getRealPath("/upload");
String realPath=url+file.getOriginalFilename();
File tempFile=new File(realPath);
//把文件上传到指定的位置
file.transferTo(tempFile);
//new 两个字节流
InputStream ins1=new FileInputStream(tempFile);
InputStream ins2=new FileInputStream(tempFile);
//new 第一个是用来读取txt前几个字节,来判断编码格式,因为你不确定上传上来的到底是什么格式
byte[]ch=new byte[1024];
ins1.read(ch);
if(Utf8Util.isUtf8(ch)){