public final class Http2ExchangeCodec extends Object implements ExchangeCodec
DISCARD_STREAM_TIMEOUT_MILLIS| 构造器和说明 |
|---|
Http2ExchangeCodec(OkHttpClient client,
RealConnection realConnection,
Interceptor.Chain chain,
Http2Connection connection) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel()
Cancel this stream.
|
RealConnection |
connection()
Returns the connection that carries this codec.
|
Sink |
createRequestBody(Request request,
long contentLength)
Returns an output stream where the request body can be streamed.
|
void |
finishRequest()
Flush the request to the underlying socket and signal no more bytes will be transmitted.
|
void |
flushRequest()
Flush the request to the underlying socket.
|
static List<Header> |
http2HeadersList(Request request) |
Source |
openResponseBodySource(Response response) |
static Response.Builder |
readHttp2HeadersList(Headers headerBlock,
Protocol protocol)
Returns headers for a name value block containing an HTTP/2 response.
|
Response.Builder |
readResponseHeaders(boolean expectContinue)
Parses bytes of a response header from an HTTP transport.
|
long |
reportedContentLength(Response response) |
Headers |
trailers()
Returns the trailers after the HTTP response.
|
void |
writeRequestHeaders(Request request)
This should update the HTTP engine's sentRequestMillis field.
|
public Http2ExchangeCodec(OkHttpClient client, RealConnection realConnection, Interceptor.Chain chain, Http2Connection connection)
public static Response.Builder readHttp2HeadersList(Headers headerBlock, Protocol protocol) throws IOException
IOExceptionpublic RealConnection connection()
ExchangeCodecconnection 在接口中 ExchangeCodecpublic Sink createRequestBody(Request request, long contentLength)
ExchangeCodeccreateRequestBody 在接口中 ExchangeCodecpublic void writeRequestHeaders(Request request) throws IOException
ExchangeCodecwriteRequestHeaders 在接口中 ExchangeCodecIOExceptionpublic void flushRequest()
throws IOException
ExchangeCodecflushRequest 在接口中 ExchangeCodecIOExceptionpublic void finishRequest()
throws IOException
ExchangeCodecfinishRequest 在接口中 ExchangeCodecIOExceptionpublic Response.Builder readResponseHeaders(boolean expectContinue) throws IOException
ExchangeCodecreadResponseHeaders 在接口中 ExchangeCodecexpectContinue - true to return null if this is an intermediate response with a "100"
response code. Otherwise this method never returns null.IOExceptionpublic long reportedContentLength(Response response)
reportedContentLength 在接口中 ExchangeCodecpublic Source openResponseBodySource(Response response)
openResponseBodySource 在接口中 ExchangeCodecpublic Headers trailers() throws IOException
ExchangeCodectrailers 在接口中 ExchangeCodecIOExceptionpublic void cancel()
ExchangeCodeccancel 在接口中 ExchangeCodecCopyright © 2025. All rights reserved.