public final class FramedStream extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
close(ErrorCode
Abnormally terminate this stream.
|
void |
closeLater(ErrorCode
Abnormally terminate this stream.
|
FramedConnection |
getConnection()
|
ErrorCode |
getErrorCode()
Returns the reason why this stream was closed, or null if it closed normally or has not yet been closed.
|
int |
getId()
|
List |
getRequestHeaders()
|
List |
getResponseHeaders()
Returns the stream's response headers, blocking if necessary if they have not been received yet.
|
okio |
getSink()
Returns a sink that can be used to write data to the peer.
|
okio |
getSource()
Returns a source that reads data from the peer.
|
boolean |
isLocallyInitiated()
Returns true if this stream was created by this peer.
|
boolean |
isOpen()
Returns true if this stream is open.
|
okio |
readTimeout()
|
void |
reply(List
Sends a reply to an incoming stream.
|
okio |
writeTimeout()
|
public int getId()
public boolean isOpen()
SYN_RESET frame abnormally terminates the stream. Note that the input stream may continue to yield data even after a stream reports itself as not open. This is because input data is buffered.
public boolean isLocallyInitiated()
public FramedConnectiongetConnection()
public List<Header > getResponseHeaders() throws IOException
IOException
public ErrorCodegetErrorCode()
public void reply(List<Header > responseHeaders, boolean out) throws IOException
out - true to create an output stream that we can use to send data to the remote peer. Corresponds to
FLAG_FIN.
IOException
public okio.Timeout readTimeout()
public okio.Timeout writeTimeout()
public okio.Source getSource()
public okio.Sink getSink()
IllegalStateException - if this stream was initiated by the peer and a
reply(java.util.List<okhttp3.internal.framed.Header>, boolean) has not yet been sent.
public void close(ErrorCoderstStatusCode) throws IOException
RST_STREAM frame has been transmitted.
IOException
public void closeLater(ErrorCodeerrorCode)
RST_STREAM frame and returns immediately.