类java.net.CacheRequest源码实例Demo

下面列出了怎么用java.net.CacheRequest的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: reader   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码2 项目: L.TileLayer.Cordova   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码3 项目: IoTgo_Android_App   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码4 项目: cordova-amazon-fireos   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码5 项目: phonegapbootcampsite   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码6 项目: bluemix-parking-meter   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码7 项目: reader   文件: HttpTransport.java
@Override public InputStream getTransferStream(CacheRequest cacheRequest) throws IOException {
  if (!httpEngine.hasResponseBody()) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine, 0);
  }

  if (httpEngine.responseHeaders.isChunked()) {
    return new ChunkedInputStream(socketIn, cacheRequest, this);
  }

  if (httpEngine.responseHeaders.getContentLength() != -1) {
    return new FixedLengthInputStream(socketIn, cacheRequest, httpEngine,
        httpEngine.responseHeaders.getContentLength());
  }

  // Wrap the input stream from the connection (rather than just returning
  // "socketIn" directly here), so that we can control its use after the
  // reference escapes.
  return new UnknownLengthHttpInputStream(socketIn, cacheRequest, httpEngine);
}
 
源代码8 项目: dragonwell8_jdk   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码9 项目: TencentKona-8   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码10 项目: libreveris   文件: JnlpResponseCache.java
@Override
public CacheRequest put (URI           uri,
                         URLConnection conn)
    throws IOException
{
    URL url = uri.toURL();
    service.loadResource(url, null, service.getDefaultProgressWindow());

    return null;
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码12 项目: Bytecoder   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码13 项目: openjdk-jdk9   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码14 项目: openjdk-jdk9   文件: TestCache.java
public synchronized CacheRequest put(URI uri, URLConnection conn)
throws IOException {
    System.out.println("put: " + uri);
    Thread.currentThread().dumpStack();
    URL url = uri.toURL();
    return new DeployCacheRequest(url, conn);

}
 
源代码15 项目: reader   文件: AbstractHttpInputStream.java
AbstractHttpInputStream(InputStream in, HttpEngine httpEngine, CacheRequest cacheRequest)
    throws IOException {
  this.in = in;
  this.httpEngine = httpEngine;

  OutputStream cacheBody = cacheRequest != null ? cacheRequest.getBody() : null;

  // some apps return a null body; for compatibility we treat that like a null cache request
  if (cacheBody == null) {
    cacheRequest = null;
  }

  this.cacheBody = cacheBody;
  this.cacheRequest = cacheRequest;
}
 
源代码16 项目: reader   文件: HttpTransport.java
public FixedLengthInputStream(InputStream is, CacheRequest cacheRequest, HttpEngine httpEngine,
    long length) throws IOException {
  super(is, httpEngine, cacheRequest);
  bytesRemaining = length;
  if (bytesRemaining == 0) {
    endOfInput();
  }
}
 
AbstractHttpInputStream(InputStream in, HttpEngine httpEngine, CacheRequest cacheRequest)
    throws IOException {
  this.in = in;
  this.httpEngine = httpEngine;

  OutputStream cacheBody = cacheRequest != null ? cacheRequest.getBody() : null;

  // some apps return a null body; for compatibility we treat that like a null cache request
  if (cacheBody == null) {
    cacheRequest = null;
  }

  this.cacheBody = cacheBody;
  this.cacheRequest = cacheRequest;
}
 
源代码18 项目: openjdk-8-source   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码19 项目: openjdk-8-source   文件: TestCache.java
public synchronized CacheRequest put(URI uri, URLConnection conn)
throws IOException {
    System.out.println("put: " + uri);
    Thread.currentThread().dumpStack();
    URL url = uri.toURL();
    return new DeployCacheRequest(url, conn);

}
 
AbstractHttpInputStream(InputStream in, HttpEngine httpEngine, CacheRequest cacheRequest)
    throws IOException {
  this.in = in;
  this.httpEngine = httpEngine;

  OutputStream cacheBody = cacheRequest != null ? cacheRequest.getBody() : null;

  // some apps return a null body; for compatibility we treat that like a null cache request
  if (cacheBody == null) {
    cacheRequest = null;
  }

  this.cacheBody = cacheBody;
  this.cacheRequest = cacheRequest;
}
 
源代码21 项目: jdk8u_jdk   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码22 项目: jdk8u_jdk   文件: TestCache.java
public synchronized CacheRequest put(URI uri, URLConnection conn)
throws IOException {
    System.out.println("put: " + uri);
    Thread.currentThread().dumpStack();
    URL url = uri.toURL();
    return new DeployCacheRequest(url, conn);

}
 
源代码23 项目: L.TileLayer.Cordova   文件: HttpTransport.java
public FixedLengthInputStream(InputStream is, CacheRequest cacheRequest, HttpEngine httpEngine,
    long length) throws IOException {
  super(is, httpEngine, cacheRequest);
  bytesRemaining = length;
  if (bytesRemaining == 0) {
    endOfInput();
  }
}
 
源代码24 项目: jdk8u-jdk   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码25 项目: android-discourse   文件: HttpTransport.java
public FixedLengthInputStream(InputStream is, CacheRequest cacheRequest, HttpEngine httpEngine, int length) throws IOException {
    super(is, httpEngine, cacheRequest);
    bytesRemaining = length;
    if (bytesRemaining == 0) {
        endOfInput();
    }
}
 
源代码26 项目: jdk8u-dev-jdk   文件: HttpURLConnection.java
public HttpInputStream (InputStream is, CacheRequest cacheRequest) {
    super (is);
    this.cacheRequest = cacheRequest;
    try {
        this.outputStream = cacheRequest.getBody();
    } catch (IOException ioex) {
        this.cacheRequest.abort();
        this.cacheRequest = null;
        this.outputStream = null;
    }
}
 
源代码27 项目: jdk8u-dev-jdk   文件: TestCache.java
public synchronized CacheRequest put(URI uri, URLConnection conn)
throws IOException {
    System.out.println("put: " + uri);
    Thread.currentThread().dumpStack();
    URL url = uri.toURL();
    return new DeployCacheRequest(url, conn);

}
 
源代码28 项目: cordova-amazon-fireos   文件: HttpTransport.java
public FixedLengthInputStream(InputStream is, CacheRequest cacheRequest, HttpEngine httpEngine,
    long length) throws IOException {
  super(is, httpEngine, cacheRequest);
  bytesRemaining = length;
  if (bytesRemaining == 0) {
    endOfInput();
  }
}
 
AbstractHttpInputStream(InputStream in, HttpEngine httpEngine, CacheRequest cacheRequest)
    throws IOException {
  this.in = in;
  this.httpEngine = httpEngine;

  OutputStream cacheBody = cacheRequest != null ? cacheRequest.getBody() : null;

  // some apps return a null body; for compatibility we treat that like a null cache request
  if (cacheBody == null) {
    cacheRequest = null;
  }

  this.cacheBody = cacheBody;
  this.cacheRequest = cacheRequest;
}
 
源代码30 项目: bluemix-parking-meter   文件: HttpTransport.java
public FixedLengthInputStream(InputStream is, CacheRequest cacheRequest, HttpEngine httpEngine,
    long length) throws IOException {
  super(is, httpEngine, cacheRequest);
  bytesRemaining = length;
  if (bytesRemaining == 0) {
    endOfInput();
  }
}
 
 类所在包
 类方法
 同包方法