客位有没有DELPHI和JAVA对应的GZIP或ZIP压缩函数呀。

我看见佛 2017-05-06 12:09:52
    public static byte[] zlibCompress(String message)throws Exception  
{
String chatacter="UTF-8";
byte[] input = message.getBytes(chatacter);
System.out.println("input length "+input.length);
byte[] output = new byte[input.length+10+new Double(Math.ceil(input.length*0.25f)).intValue()];
System.out.println(output.length);
Deflater compresser = new Deflater();
compresser.setInput(input);
compresser.finish();
int compressedDataLength = compresser.deflate(output);
System.out.println("compressedDataLength "+compressedDataLength);
compresser.end();
//String ostr=new String(output,0,compressedDataLength,chatacter);
//System.out.println("out str "+ostr);
return Arrays.copyOf(output, compressedDataLength);
}


客位有没有DELPHI和JAVA对应的GZIP或ZIP压缩函数呀。
我测试的死活对应不上,要么是少字符时可对应,但是字符一长又对应不了
...全文
184 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZLOZL 2019-06-18
  • 打赏
  • 举报
回复
请问下 java gzip 压缩后 base64 编码 delphi 怎么还原? 或者java gzip 压缩后 delphi用 zlibex 那个函数解码?
22222bbb 2017-05-11
  • 打赏
  • 举报
回复
zlibEx试试

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧