2条回答 默认 最新
- duanbo6871 2013-10-24 04:04关注
You have 3 options.
- Try another library, perhaps one that uses cgo. I see two here.
- Use cgo directly/make your own lib.
- Use the xz executable.
Option three is easier than it sounds. Here is what I would use:
func xzReader(r io.Reader) io.ReadCloser { rpipe, wpipe := io.Pipe() cmd := exec.Command("xz", "--decompress", "--stdout") cmd.Stdin = r cmd.Stdout = wpipe go func() { err := cmd.Run() wpipe.CloseWithError(err) }() return rpipe }
Runnable code here: http://play.golang.org/p/SrgZiKdv9a
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 关于大棚监测的pcb板设计
- ¥15 stm32开发clion时遇到的编译问题
- ¥15 lna设计 源简并电感型共源放大器
- ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
- ¥15 Vue3地图和异步函数使用
- ¥15 C++ yoloV5改写遇到的问题
- ¥20 win11修改中文用户名路径
- ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入