1 | lib 1005255 // apache commons compress |
2 | |
3 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; |
4 | |
5 | static byte[] bzipString(S s) ctex { |
6 | new ByteArrayOutputStream baos; |
7 | BZip2CompressorOutputStream bzos = new(baos); |
8 | OutputStreamWriter outputStreamWriter = new OutputStreamWriter(bzos, "UTF-8"); |
9 | PrintWriter printWriter = new(outputStreamWriter); |
10 | printWriter.print(s); |
11 | printWriter.close(); |
12 | bzos.close(); |
13 | ret baos.toByteArray(); |
14 | } |
Began life as a copy of #1006276
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020478 |
Snippet name: | bzipString - bzip2-compress an UTF8-encoded string |
Eternal ID of this version: | #1020478/2 |
Text MD5: | 9523b721485c72f75fa40e7912971e63 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-23 19:41:28 |
Source code size: | 479 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 293 / 327 |
Version history: | 1 change(s) |
Referenced in: | [show references] |