Hi everyone! I had a question about some data I'm extracting from an XML file. I'm pretty sure it's compressed, but I can't seem to decompress it using the InflaterInputStream method. I've been copying the text from the XML to actual .txt files so I could mess with it.
I've tried 3 different methods of input:
1. The straight text (which looks like hexidecimal)
2. Binary
3. Hexidecimal converted to text (which looks more normal for and encrypted file)
When I run the first two with the Inflater method I get a "Unknown compression method" error. But with the last this does not occur, however the output file is blank.
Samples of the 3 formats are below, as is some of the code I'm using. Any help would be appreciated.
straight text as in XML:
Not even gonna post binary its too long...789cdd576d73e23610fe2b3bedcc4dae7324c604f2c2971a43 2e342150ec5ca633fe226c1974272c9f2c27a10cffbd2bd904 73716fd299bb36bd2f42c8dab76757fb48eb40aab819902463 411ef220a2716ce9919364deb45aaded3ca6fadf3a8845a2d4 8ce3c40ae2ec81655910870b2233aa7021959f6d702423bcbb d9ac835070217177379034b282b9a434b18219cfa9d5c5cfbf e0f23d7e86f56df229110f89114a396149a1bed9814049f110 e13827e9e2c4c209a7b16a9c58108494f3c756d3b68a59c73e 2e6767ad8e15a44446c108b42c5711ab0441b2a568bf984284 613750efb168319f4c6e3abc1f41ddc0dafaf87ce086e8cda2 f1ceb13456b649bc7f01b49c0b6ac36343bf86fe0f975e24e9 a2af057699d8ee9f8d62f6d1a570384c0780e9b2200230095e 848f431cf9464f385425ce69245f0ef01794142c6995ad544e 28f86939edd73bc815d0782cb59c2c21a39f7d2f5c007a75f8 bdd448a7b16515923e8f447c39ba1e74f1d7f8c19f4fef0fcc 1a8164a3d4231aeffbb4350c9e72e8a20e7e0e44ab84cd10c8 29905531a4b9a2d6804b3557d8cf06b7de9e9f85e5e349bd70 b8817ea7d2c991b40ee24538a26df178e2a0c7a08d379d36ed b3b3814999dd8565df830f2c04319f0a864b16e76a82896624 99227646cf056cb99e0e6abfd84dbdfa0550b5635250b21ff8 c44a8db6a61014c8be5e5bc885a3db63a6778f81f3bc7a7d61 6667b07f397006d3f42cd5eddc3049eaa257651ac509289042 e84840f2c63d856c92c124b96100e294a76e1493562c269a8b 0980ba183ec6d55aedcb7677d5f171cdcd087b7e08aa5369d1 522b5f1999ef98a8bda399abcb89cdbbb72b66dfbe4bb95f31 e2455c7d1ebb566b843e839ee95e35e0e8299090d5737eb4a3 a36ebf2c31ee7b4b69c53920bb2cc96664e8feb69a6ca32017 a07231ab11079db14cd3914d4058d093606e4206413f80013a 14896b17c09638905e39319a70aecb605cb393460f41e7ca70 7bd5bf71a7ec772b3611ae358c71125517cc320b60efb54491 2ae42f498c2a5cb0b575d926639a7d0b676bebacee4b9af453 923e8e37b2a31b3b43c4988888b45cb925cf7495f52620ee75 33e0aa13b22751fc544415fe67318268aa2371a55d87e2b44f e3f98583f2626dfa2b07f48605a6188fc1a53b5421295e8044 520de3fb68f4e7f8211cbf4a64338c07671e8e5293fecde88a 4a1fd47aad9ee6fc1f21a85e0118c54037ac33eb6dbe97b180 d3d177eb6f1da75d1424caf0630f4c1f36f27b8c1206b19685 be0292255f912b09a47cdf69169cf638997d3e7cbb67d6eb7b e960e2f5c08c1a12794e2f42b79c0887417a445465e9885d74 c837d96a502c95f17d50be910097077bb3bb13aff9c0ecb7b4 dcc1acdb655e138fd00c30b0ac9f08272c7d442e40aaed9922 9c33b596567f97ca855314c3ee672056f60c87942b36cf756d 1823742c19d909fb4254c64d4352b3da213bf5b73f1672e243 eac8c3646b37746eac897a8499f5a97e4191699aeee52b8b46 b1cabdecf5c4eb413e35ca5c5bb77df77ce9e45307833c2061 1d17dcfcfceec66130fcb20433ee6ccbc492a4a47e8d7129b1 35e7bef59480b231ba86466ff52cfe6092ae8ad4cda6bb28a9 b4c53d00e1e637fa84de87af7aaaead1663bdf214350b9bcd5 f2d4df6fa
XML version converted to "normal text":
Some code:x?ÝWmsâ6þ+;íÌM®s$ÆòÂ?C.4!Pì\¦3þ"lt',?,'¡ÿ½+ÙsqoÒ?» 6½/BÈÚ·gWûHë@ª¸?$cAò ¢qlé??dÞ´Z*í<¦úß:?E¢Ô?ãÄ
âì?eY?"3ªp!??mp$#¼»Ù¬?Pp!qw7?4²?¹¤4±?Ï©ÕÅÏ¿àò=~?õm ò)?J9aI¡¾Ù?@Iñá8'éâÄ §±j?X??óÇVÓ¶?YÇ>.gg*?¤DFÁ´,W«A²¥h¿?B?a7Pï±h1?Ln:¼A ÝÀÚúø|à?èÍ¢ñα4V¶I¼´?jÃcC¿?þ?^$颯v?Øî??böÑ¥p8L?é ² 0 ^??CùFO8T%Îi$_ð?,i?*TN(øi9í×;ÈÐx,µ?,!£?}/\?zuø½ÔH§±e?>?D|9ºtñ×øÁ?OïÌ?d£Ô#ïû´5?rè¢~D«?ÍÈ)?U1 ¤¹¢Ö?K5WØÏ·Þ???åãI½p¸?~§ÒÉ?´âE8¢mñxâ Ç ?7?6í³³?I?Ý?eß?,1?
?Kçj??f$?"vFÏl¹?j¿ØM½úPµcRP²øÄJ?¶¦È¾^[È?£Ûc¦w??ó¼z}afg°9pÓô,ÕíÜ0Iê¢WeÅ (?BèH@òÆ=?l?Á$¹a?â?§n?V,&?? ?º>ÆÕZíËvwÕñqÍÍ{~ªSiÑR+_?ï?¨½£?«Ë?Í»·+fß¾K¹_1âE\}» Vk?>??é^5àè)??Õs~´££n¿,1î{KiÅ9 »,Éfdèþ¶?l£ r1«?±LÓ?M@XÐ?`nBA??:?kÀ?8?^91?p®Ë`\³?FAçÊp{Õ¿q§ìw+ 6®5?qUÌ2`ïµD?*ä/I?*\°µuÙ&c?}gkë¬îK?ôS?>?7²£;CÄ???´\¹%Ït?õ& îu3લ'QüTDþg1?hª#q¥]?â´Oãù??òbmú+ô?¦?Á¥;T!)^?DR
ãûhôçø!¿Jd3?g?R?þÍè?JÔz*?æü!¨^Å@7¬3ëm¾?±?ÓÑwëo§]$ÊðcL6ò{?±??¾?%_?+ ¤|ßi?ö8?}>|»gÖë{é`âõÀ?yN/B·??AzDTeé?]tÈ7ÙjP,?ñ}P¾???{³»¯ùÀì·´ÜÁ¬Ûe^?Ð0°¬?',}D.@ªí?"?3µ? V?Ê?SÃîg Vö??+6Ïum#t,Ù ûBTÆMCR³Ú!;õ·?râCêÈÃdk7tn¬?z??õ©~A?i?îå+?F±Ê½ìõÄëA >5Ê\[·}÷|éäS?< aÜüüîÆa0ü²3îlËÄ?¤¤~?q)±5ç¾õ??²1º?Foõ,þ`?®?Ôͦ»(©´Å =?áæ7ú?Þ?¯zªêÑf;ß!CP¹¼ÕòÔßo
Thanks again for any advice!FileInputStream fis2 = new FileInputStream("original.txt"); InflaterInputStream iis = new InflaterInputStream(fis2); FileOutputStream fos2 = new FileOutputStream("inflatedoriginal.txt"); System.out.println("start copying the output"); doCopy(iis, fos2); } public static void doCopy(InputStream is, OutputStream os) throws Exception { int oneByte; while ((oneByte = is.read()) != -1) { System.out.println(oneByte); os.write(oneByte); }