(フェッチする)は、iが範囲ヘッダーを使用して、組み合わせたものが私のコードをpieces.and:アプリエンジンで1M以上UrlFetchの程度問題
int startpos=0;
int endpos;
int seg=1;
int len=1;
while(len>0){
endpos=startpos+seg;
httpConn = (HttpURLConnection) u.openConnection();
httpConn.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14");
con.setRequestProperty("Range", "bytes=" + startpos + "-" + endpos);
con.connect();
InputStream in=con.getInputStream();
len=con.getContentLength();
byte[] b=new byte[len];
in.read(b, 0, len);
startpos+=len;
} が、それは行くとき"InputStreamで= con.getInputStream();"、そのデバッグは "URLフェッチ応答が大きすぎる問題" だから私はこれらのコードで何が間違っているのか分からない。 1M以外でfetch()する方法はありますか?
をあなたが二回 'B'宣言したように、そのコードがさえ*、*コンパイルべきではありません... –
はどんな利点がありますchunk-by-chunkを一度要求してchunk-by-chunkを読むのではなく、チャンクごとに要求しますか? 'b'を二度宣言したので、コードはコンパイルされません。 – khachik
[App Engine Urlfetch over 1M?]の複製が可能ですか?(http://stackoverflow.com/questions/4421322/app-engine-urlfetch-over-1m) – systempuntoout