public class AbstractBceStreamResponse extends AbstractBceResponse implements Closeable
metadata| Constructor and Description |
|---|
AbstractBceStreamResponse() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the content stream and the underlying HTTP response.
|
InputStream |
getContent()
Gets the content stream from the response.
|
long |
getContentLength()
Gets the content length of the response.
|
String |
getContentType()
Gets the content type of the response.
|
void |
populateStream(InputStream stream)
默认实现:将响应流写入 content 字段。
生成的 response 子类可覆写此方法,将流写入用户指定的字段。
|
void |
setContent(InputStream content)
Sets the content stream.
|
void |
setContentLength(long contentLength)
Sets the content length of the response.
|
void |
setContentType(String contentType)
Sets the content type of the response.
|
void |
setHttpResponse(org.apache.http.client.methods.CloseableHttpResponse httpResponse)
Sets the underlying HTTP response for proper resource management.
|
getMetadata, setMetadata, toJsonStringpublic InputStream getContent()
public void setContent(InputStream content)
content - the content streampublic void populateStream(InputStream stream)
public void setHttpResponse(org.apache.http.client.methods.CloseableHttpResponse httpResponse)
httpResponse - the HTTP responsepublic String getContentType()
public void setContentType(String contentType)
contentType - the content typepublic long getContentLength()
public void setContentLength(long contentLength)
contentLength - the content lengthpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occursCopyright © 2026. All rights reserved.