static ThreadLocal<Map<S, L<S>>> loadBinaryPage_responseHeaders = new ThreadLocal; static ThreadLocal<SS> loadBinaryPage_extraHeaders = new ThreadLocal; static byte[] loadBinaryPage(String url) ctex { print("Loading " + url); return loadBinaryPage(loadPage_openConnection(new URL(url))); } static byte[] loadBinaryPage(URLConnection con) ctex { SS extraHeaders = getAndClearThreadLocal(loadBinaryPage_extraHeaders); setHeaders(con); for (S key : keys(extraHeaders)) con.setRequestProperty(key, extraHeaders.get(key)); ret loadBinaryPage_noHeaders(con); } static byte[] loadBinaryPage_noHeaders(URLConnection con) ctex { ByteArrayOutputStream buf = new ByteArrayOutputStream(); InputStream inputStream = con.getInputStream(); loadBinaryPage_responseHeaders.set(con.getHeaderFields()); long len = 0; try { len = con.getContentLength/*Long*/(); } catch (Throwable e) { printStackTrace(e); } int n = 0; while (true) { int ch = inputStream.read(); if (ch < 0) break; buf.write(ch); if (++n % 100000 == 0) println(" " + n + (len != 0 ? "/" + len : "") + " bytes loaded."); } inputStream.close(); return buf.toByteArray(); }
Began life as a copy of #2000466
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment