public final class ResponseHandlingInputStream
extends java.io.FilterInputStream
InputStream that caches the data as the data is read, and writes them to the given
OutputStream. This also guarantees that we will attempt to reach EOF on the
InputStream passing all data to the OutputStream.
This is done to allow us to guarantee all responses are represented in the webkit inspector.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG |
| Constructor and Description |
|---|
ResponseHandlingInputStream(java.io.InputStream inputStream,
java.lang.String requestId,
java.io.OutputStream outputStream,
com.facebook.stetho.inspector.network.CountingOutputStream decompressedCounter,
ChromePeerManager networkPeerManager,
ResponseHandler responseHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
public static final java.lang.String TAG
public ResponseHandlingInputStream(java.io.InputStream inputStream,
java.lang.String requestId,
java.io.OutputStream outputStream,
com.facebook.stetho.inspector.network.CountingOutputStream decompressedCounter,
ChromePeerManager networkPeerManager,
ResponseHandler responseHandler)
inputStream - requestId - the requestId to use when we call the NetworkEventReporteroutputStream - stream to write to.decompressedCounter - Optional decompressing counting output stream which
can be queried after each write to determine the number of decompressed bytes
yielded. Used to implement ResponseHandler.onReadDecoded(int).networkPeerManager - A peer manager which is used to log internal errors to the
Inspector console.responseHandler - Special interface to intercept read events before they are sent
to peers via NetworkEventReporter methods.public int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.FilterInputStreampublic void mark(int readlimit)
mark in class java.io.FilterInputStreampublic void reset()
throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOException