2chの専ブラをつくってるのですが、差分取得が上手くいきません。
      int totalContentLength = 0; // 前回までの取得byte
      long lastModified= 0L; // 前回更新
...
      String range = "bytes=" + totalContentLength + "-";
      // HTTP通信の開始
      URL url = new URL(threadUrl);
      connection = (HttpURLConnection) url.openConnection();
      connection.setRequestMethod("GET");
      connection.setReadTimeout(2000);
      connection.setDoOutput(true);
      connection.setRequestProperty("User-Agent", "Monazilla/1.00");
      if(lastModified > 0 && totalContentLength > 0) {
        // 差分取得
        connection.setRequestProperty("Range", range);
        connection.setIfModifiedSince(lastModified);
      } else {
        // 初回のみGZIP取得
        connection.setRequestProperty("Accept-Encoding", "gzip");
      }
      connection.connect();
...
上のコードを実行すると、初回アクセス時はステータスコード200でgzipのデータが取得できます。
しかし、二回目以降Range,IfModifiedSinceを指定しても416が返ってきます。
上記とほぼ同じコードをwindows上で動かしたところ問題なく差分取得ができています。
また、IfModifiedSince,Range等の値に問題が無いこともログで確認しています。
原因が分かる方がいましたらお願いします。