Most visited

Recently visited

Added in API level 1

CacheRequest

public abstract class CacheRequest
extends Object

java.lang.Object
   ↳ java.net.CacheRequest


表示用于在ResponseCache中存储资源的通道。 这样的类的实例提供了一个OutputStream对象,该对象被协议处理程序调用以将资源数据存储到缓存中,还提供了允许缓存存储操作被中断和放弃的abort()方法。 如果在读取响应或写入缓存时遇到IOException,当前缓存存储操作将中止。

Summary

Public constructors

CacheRequest()

Public methods

abstract void abort()

中止尝试缓存响应。

abstract OutputStream getBody()

返回可以写入响应正文的OutputStream。

Inherited methods

From class java.lang.Object

Public constructors

CacheRequest

Added in API level 1
CacheRequest ()

Public methods

abort

Added in API level 1
void abort ()

中止尝试缓存响应。 如果在读取响应或写入缓存时遇到IOException,则当前的缓存存储操作将被废弃。

getBody

Added in API level 1
OutputStream getBody ()

返回可以写入响应正文的OutputStream。

Returns
OutputStream an OutputStream to which the response body can be written
Throws
IOException if an I/O error occurs while writing the response body

Hooray!