Class Apache5ResponseContent (1.45.2)

public class Apache5ResponseContent extends InputStream

Class that wraps an org.apache.hc.core5.http.HttpEntity's content InputStream along with the ClassicHttpResponse that contains this entity. The main purpose is to be able to close the response as well as the content input stream when #close() is called, in order to not break the existing contract with clients using apache v4 that only required them to close the input stream to clean up all resources.

Inheritance

java.lang.Object > InputStream > Apache5ResponseContent

Constructors

Apache5ResponseContent(InputStream wrappedStream, ClassicHttpResponse response)

public Apache5ResponseContent(InputStream wrappedStream, ClassicHttpResponse response)
Parameters
Name Description
wrappedStream InputStream
response org.apache.hc.core5.http.ClassicHttpResponse

Methods

available()

public int available()
Returns
Type Description
int
Overrides
Exceptions
Type Description
IOException

close()

public void close()
Overrides
Exceptions
Type Description
IOException

mark(int readlimit)

public synchronized void mark(int readlimit)
Parameter
Name Description
readlimit int
Overrides

markSupported()

public boolean markSupported()
Returns
Type Description
boolean
Overrides

read()

public int read()
Returns
Type Description
int
Overrides
Exceptions
Type Description
IOException

read(byte[] b)

public int read(byte[] b)
Parameter
Name Description
b byte[]
Returns
Type Description
int
Overrides
Exceptions
Type Description
IOException

read(byte[] b, int off, int len)

public int read(byte[] b, int off, int len)
Parameters
Name Description
b byte[]
off int
len int
Returns
Type Description
int
Overrides
Exceptions
Type Description
IOException

reset()

public synchronized void reset()
Overrides
Exceptions
Type Description
IOException

skip(long n)

public long skip(long n)
Parameter
Name Description
n long
Returns
Type Description
long
Overrides
Exceptions
Type Description
IOException