public class RemoteBase.HttpClientClosingInputStream extends InputStream
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
delegateStream
The input stream delivering the actual data
|
protected org.apache.http.HttpResponse |
httpResponse
The http response to close when the stream is closed
|
| Constructor and Description |
|---|
HttpClientClosingInputStream(org.apache.http.HttpResponse resp)
Constructs an HttpClientClosingInputStream from a source stream and an http response.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
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) |
String |
toString() |
protected InputStream delegateStream
protected org.apache.http.HttpResponse httpResponse
public HttpClientClosingInputStream(org.apache.http.HttpResponse resp)
throws IllegalStateException,
IOException
IOExceptionIllegalStateExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionInputStream.read()public int available()
throws IOException
available in class InputStreamIOExceptionInputStream.available()public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionInputStream.close()public void mark(int readlimit)
mark in class InputStreamreadlimit - InputStream.mark(int)public boolean markSupported()
markSupported in class InputStreamInputStream.markSupported()public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - the buffer into which the data is read.off - the start offset in array b at which the data is written.len - the maximum number of bytes to read.-1 if there is no more data because the
end of the stream has been reached.IOException - If the first byte cannot be read for any reason other than end of file, or if the input stream has
been closed, or if some other I/O error occurs.NullPointerException - If b is null.IndexOutOfBoundsException - If off is negative, len is negative, or len is greater than
b.length - offInputStream.read(byte[], int, int)public int read(byte[] b)
throws IOException
read in class InputStreamb - the buffer into which the data is read.-1 is there is no more data because the
end of the stream has been reached.IOException - If the first byte cannot be read for any reason other than the end of the file, if the input stream
has been closed, or if some other I/O error occurs.NullPointerException - if b is null.InputStream.read(byte[])public void reset()
throws IOException
reset in class InputStreamIOExceptionInputStream.reset()public long skip(long n)
throws IOException
skip in class InputStreamn - the number of bytes to be skipped.IOException - if the stream does not support seek, or if some other I/O error occurs.InputStream.skip(long)public String toString()
toString in class ObjectObject.toString()Copyright © 2009–2020 Opencast Project. All rights reserved.