<div><span style="font-size:9pt;line-height:1.5;">이미지 byte를 zlib로 압축을 해서 안드로이드 쪽에서 압축을 해제하려고 합니다.</span></div> <div><span style="font-size:9pt;line-height:1.5;"><br></span></div> <div>API문서를 보니</div> <div> <h4 class="jd-details-title" style="line-height:21px;font-size:1.15em;margin:1.5em 0px .6em;font-weight:500;padding:3px 95px 3px 3px;color:#222222;font-family:Roboto, sans-serif;background-color:#e2e2e2;"><span class="normal">public </span><span class="sympad" style="margin-right:2px;">Inflater</span> <span class="normal">(boolean noHeader)</span></h4> <div class="api-level" style="font-size:.8em;color:#999999;float:right;padding:0px 8px;margin-top:-30px;font-family:Roboto, sans-serif;line-height:19px;background-color:#f9f9f9;">Added in <a target="_blank" href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels" style="color:#258aaf;text-decoration:none;" target="_blank">API level 1</a></div> <div class="jd-details-descr" style="padding:0px;margin:.5em .25em;color:#222222;font-family:Roboto, sans-serif;font-size:14px;line-height:19px;background-color:#f9f9f9;"> <div class="jd-tagdata jd-tagdescr" style="margin:.25em 0px .75em;"> <p style="margin:0px 0px 1em 1em;">This constructor allows to create an inflater that expects no header from the input stream.</p></div> <div class="jd-tagdata" style="margin:.5em 1em;"> <h5 class="jd-tagtitle" style="font-size:1em;margin:0px 0px .25em;">Parameters</h5> <table class="jd-tagtable" style="font-size:1em;margin:0px;border-collapse:collapse;border-spacing:0px;border:0px;width:auto;background-color:transparent;"><tbody><tr><th style="padding:2px 10px;vertical-align:top;color:inherit;border:none;font-weight:normal;font-style:italic;background-color:transparent;">noHeader</th> <td style="padding:2px 10px;vertical-align:top;border:none;background-color:transparent;"><code style="font-size:13px;color:#006600;line-height:14px;margin-bottom:0px;">true</code> indicates that no ZLIB header comes with the input.</td></tr></tbody></table></div></div></div> <div><span style="color:#222222;font-family:Roboto, sans-serif;font-size:14px;line-height:19px;background-color:#f9f9f9;"><br></span></div> <div><span style="color:#222222;font-family:Roboto, sans-serif;font-size:14px;line-height:19px;background-color:#f9f9f9;"> 번역기를 돌려보니 대충</span></div> <h4 class="jd-details-title" style="line-height:21px;font-size:1.15em;margin:1.5em 0px .6em;font-weight:500;padding:3px 95px 3px 3px;color:#222222;font-family:Roboto, sans-serif;background-color:#e2e2e2;"><span class="normal">noHeader 부분이 참이면 </span><span style="line-height:19px;background-color:#ffffff;">더 ZLIB 헤더가 입력되어 없음을 나타냅니다.</span></h4> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;"><br></span></font></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif">이런식으로 나오더군요..</font></span></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif"><br></font></span></div> <div><span style="color:#222222;font-family:Roboto, sans-serif;font-size:14px;line-height:19px;background-color:#f9f9f9;">생성자에서 false 값을 넘겨준다면 압축해제 할때 넘겨주는 byte에 zlib의 헤더가 있다는 얘기이고 true라면 zlib의 헤더가 없다는 얘기로 이해하면 되는 건가요?</span></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif"><br></font></span></div> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;">인터넷에서 검색해본 결과 zlib로 압축을 하면 압축된 byte에 zlib 헤더가 붙는다고 나와있습니다.</span></font></div> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><br></span></font></div> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;">API 문서를 보고 </span></font><span style="color:#222222;font-family:Roboto, sans-serif;font-size:14px;line-height:19px;background-color:#f9f9f9;">zlib 헤더가 붙어있으니 </span><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;">안드 쪽에서도 압축을 해제할 수 있을 것이라고 생각했습니다.</span></font></div> <div><br></div> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;">생성자 부분에서 true로 값을 주면 </span></font></div> <div><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><br></span></font></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif">java.util.zip.DataFormatException: invalid code lengths set 에러가 나오고..</font></span></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif"><br></font></span></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif">false 시엔 </font></span><font color="#222222" face="Roboto, sans-serif"><span style="font-size:14px;line-height:19px;">java.util.zip.dataformatexception incorrect header check 에러가 나옵니다.</span></font></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif"><br></font></span></div> <div><span style="font-size:14px;line-height:19px;background-color:#f9f9f9;"><font color="#222222" face="Roboto, sans-serif"></font></span> <div>Inflater inflater = new Inflater();</div> <div>inflater.setInput(compressByte, 0, compressByte.length);</div> <div>int decompressSize = 0;</div> <div>try {</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>decompressSize = inflater.inflate(bitmapByte);</div> <div>} catch (DataFormatException e) {</div> <div>// TODO Auto-generated catch block</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>Log.i("decompressSize : ",decompressSize + "");</div> <div><span class="Apple-tab-span" style="white-space:pre;"> </span>e.printStackTrace();</div> <div>}</div> <div>inflater.end();</div> <div><br></div> <div>아니면 JNI로 연동해야하는 건가요?</div></div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.