hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CodingForever <nighttmm...@gmail.com>
Subject Re: Header and Content parsing and saving as html page
Date Mon, 14 Feb 2011 14:13:42 GMT

Hi, oleg
I used the code that you have post. But I have some problems;

1- My message can consist of multiple parts so when data transferred as
chunked.(incompleted chunks) It throws;

---------------------------------------------------------
org.apache.http.TruncatedChunkException: Truncated chunk ( expected size:
8106; actual size: 899)
        at
org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:182)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.Reader.read(Reader.java:140)
------------------------------------------------------------- 

2- When I buffered all data, buffer(all chunks) reaches big buffer size and
also it throws;

---------------------------------------------------------------
org.apache.http.MalformedChunkCodingException: Unexpected content at the end
of chunk
at
org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:239)
        at
org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:204)
        at
org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:167)
        at
org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:196)
        at
org.apache.http.impl.io.ChunkedInputStream.close(ChunkedInputStream.java:292)
        at sun.nio.cs.StreamDecoder.implClose(StreamDecoder.java:376)
        at sun.nio.cs.StreamDecoder.close(StreamDecoder.java:191)
        at java.io.InputStreamReader.close(InputStreamReader.java:199)
        at org.apache.http.util.EntityUtils.toString(EntityUtils.java:203)
        at org.apache.http.util.EntityUtils.toString(EntityUtils.java:221)
----------------------------------------------------------------------------------

Best Regards.
-- 
View this message in context: http://old.nabble.com/Header-and-Content-parsing-and-saving-as-html-page-tp30897495p30922010.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message