Read fast or die

I have spend a lot of time today trying to find and fix an issue which ended up to be a fun discovery at the end. The following java error occurred when loading a pdf file from an url stream: <pre lang="java">java.io.IOException: missing CR at sun.net.www.http.ChunkedInputStream.processRaw(ChunkedInputStream.java:405) at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:572) at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609) at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3066) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3060) This looked like a java lib error since java version was a bit old so the first idea was to replace the code with some apache httpClient based code to load the URL....

April 11, 2016 ยท len