您好,欢迎来到12图资源库!分享精神,快乐你我!我们只是素材的搬运工!!
  • 首 页
  • 当前位置:首页 > 开发 > WEB开发 >
    效劳端WORD文件模板书签交流、转换文件类型的另类完成(10)
    时间:2021-08-11 08:50 来源:网络整理 作者:网络 浏览:收藏 挑错 推荐 打印

                    LOGGER.info("======== 末尾向效劳端传送源文件" + srcRealPath + " ========"); 

                    byte[] bytes = new byte[1024]; 

                    long progress = 0L; 

     

                    int length; 

                    while((length = this.fis.read(bytes, 0, bytes.length)) != -1) { 

                        this.dos.write(bytes, 0, length); 

                        this.dos.flush(); 

                        progress += (long)length; 

                        LOGGER.info("| " + 100L * progress / file.length() + "% |"); 

                    } 

     

                    LOGGER.info("======== 文件传输成功 (" + file.length() / 1048576L + ")M========"); 

                    this.client.shutdownOutput(); 

                    LOGGER.info("======== 末尾转换" + ext + " ========"); 

                    InputStream inputStream = this.client.getInputStream(); 

                    this.dis = new DataInputStream(inputStream); 

                    String result = this.dis.readUTF(); 

                    if ("error".equals(result)) { 

                        String reason = this.dis.readUTF(); 

                        LOGGER.info(reason); 

                        code = "500"

                        message = reason; 

                    } else if ("info".equals(result)) { 

                        long l = this.dis.readLong(); 

    (责任编辑:admin)