Java Code Examples for com.squareup.okhttp.internal.Util#hash()

The following examples show how to use com.squareup.okhttp.internal.Util#hash() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GifLoadTask.java    From sctalk with Apache License 2.0 6 votes vote down vote up
private FilterInputStream getFromCache(String url) throws Exception {
    DiskLruCache cache = DiskLruCache.open(CommonUtil.getImageSavePath(), 1, 2, 2*1024*1024);
    cache.flush();
    String key = Util.hash(url);
    final DiskLruCache.Snapshot snapshot;
    try {
        snapshot = cache.get(key);
        if (snapshot == null) {
            return null;
        }
    } catch (IOException e) {
        return null;
    }
    FilterInputStream bodyIn = new FilterInputStream(snapshot.getInputStream(1)) {
        @Override
        public void close() throws IOException {
            snapshot.close();
            super.close();
        }
    };
    return bodyIn;
}
 
Example 2
Source File: HttpResponseCache.java    From L.TileLayer.Cordova with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 3
Source File: HttpResponseCache.java    From IoTgo_Android_App with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 4
Source File: HttpResponseCache.java    From android-discourse with Apache License 2.0 4 votes vote down vote up
private String uriToKey(URI uri) {
    return Util.hash(uri.toString());
}
 
Example 5
Source File: HttpResponseCache.java    From bluemix-parking-meter with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 6
Source File: HttpResponseCache.java    From reader with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 7
Source File: HttpResponseCache.java    From reader with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 8
Source File: HttpResponseCache.java    From cordova-amazon-fireos with Apache License 2.0 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 9
Source File: HttpResponseCache.java    From phonegapbootcampsite with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 10
Source File: HttpResponseCache.java    From CordovaYoutubeVideoPlayer with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 11
Source File: HttpResponseCache.java    From wildfly-samples with MIT License 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}
 
Example 12
Source File: HttpResponseCache.java    From crosswalk-cordova-android with Apache License 2.0 4 votes vote down vote up
private String uriToKey(URI uri) {
  return Util.hash(uri.toString());
}