| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
Public 成员函数 | Protected 成员函数 | Protected 属性 | 静态 Protected 属性 | Private 成员函数 | 静态 Private 成员函数 | 静态 Private 属性 | 所有成员列表
com.ab.network.toolbox.BasicNetwork类 参考
类 com.ab.network.toolbox.BasicNetwork 继承关系图:

## Public 成员函数
| BasicNetwork (HttpStack httpStack)
| BasicNetwork (HttpStack httpStack, ByteArrayPool pool)
NetworkResponse | performRequest (Request<?> request) throws VolleyError

## Protected 成员函数
void | logError (String what, String url, long start)

## Protected 属性
final HttpStack | mHttpStack
final ByteArrayPool | mPool

## 静态 Protected 属性
static final boolean | DEBUG = VolleyLog.DEBUG

## Private 成员函数
void | logSlowRequests (long requestLifetime, Request<?> request, byte[] responseContents, StatusLine statusLine)
void | addCacheHeaders (Map< String, String > headers, Cache.Entry entry)
byte[] | entityToBytes (HttpEntity entity) throws IOException, ServerError

## 静态 Private 成员函数
static void | attemptRetryOnException (String logPrefix, Request<?> request, VolleyError exception) throws VolleyError
static Map< String, String > | convertHeaders (Header[] headers)

## 静态 Private 属性
static int | SLOW_REQUEST_THRESHOLD_MS = 3000
static int | DEFAULT_POOL_SIZE = 4096

## 详细描述

A network performing Volley requests over an HttpStack.

## 构造及析构函数说明

com.ab.network.toolbox.BasicNetwork.BasicNetwork | ( | HttpStack | httpStack | ) |
| inline

参数

  httpStack | HTTP stack to be used

com.ab.network.toolbox.BasicNetwork.BasicNetwork | ( | HttpStack | httpStack,
|  | ByteArrayPool | pool
| ) |  |
| inline

参数

  httpStack | HTTP stack to be used
  pool | a buffer pool that improves GC performance in copy operations

## 成员函数说明

void com.ab.network.toolbox.BasicNetwork.addCacheHeaders | ( | Map< String, String > | headers,
|  | Cache.Entry | entry
| ) |  |
| inline private

static void com.ab.network.toolbox.BasicNetwork.attemptRetryOnException | ( | String | logPrefix,
|  | Request<?> | request,
|  | VolleyError | exception
| ) |  | throws VolleyError
| inline static private

Attempts to prepare the request for a retry. If there are no more attempts remaining in the request's retry policy, a timeout exception is thrown.

参数

  request | The request to use.

static Map<String, String> com.ab.network.toolbox.BasicNetwork.convertHeaders | ( | Header[] | headers | ) |
| inline static private

Converts Headers[] to Map<String, String>.

byte [] com.ab.network.toolbox.BasicNetwork.entityToBytes | ( | HttpEntity | entity | ) | throws IOException, ServerError
| inline private

Reads the contents of HttpEntity into a byte[].

void com.ab.network.toolbox.BasicNetwork.logError | ( | String | what,
|  | String | url,
|  | long | start
| ) |  |
| inline protected

void com.ab.network.toolbox.BasicNetwork.logSlowRequests | ( | long | requestLifetime,
|  | Request<?> | request,
|  | byte[] | responseContents,
|  | StatusLine | statusLine
| ) |  |
| inline private

Logs requests that took over SLOW_REQUEST_THRESHOLD_MS to complete.

NetworkResponse com.ab.network.toolbox.BasicNetwork.performRequest | ( | Request<?> | request | ) | throws VolleyError
| inline

Performs the specified request.

参数

  request | Request to process

返回
  A NetworkResponse with data and caching metadata; will never be null

异常

  VolleyError | on errors

实现了 com.ab.network.toolbox.Network.

## 类成员变量说明

final boolean com.ab.network.toolbox.BasicNetwork.DEBUG = VolleyLog.DEBUG
| static protected

int com.ab.network.toolbox.BasicNetwork.DEFAULT_POOL_SIZE = 4096
| static private

final HttpStack com.ab.network.toolbox.BasicNetwork.mHttpStack
| protected

final ByteArrayPool com.ab.network.toolbox.BasicNetwork.mPool
| protected

int com.ab.network.toolbox.BasicNetwork.SLOW_REQUEST_THRESHOLD_MS = 3000
| static private

该类的文档由以下文件生成:

- src/com/ab/network/toolbox/BasicNetwork.java