| Constructor and Description |
|---|
ResourceBody(HttpResource resource)
构造
|
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
获取写出字节长度,未知为-1
|
String |
contentType()
获取Content-Type
根据实现不同,Content-Type可能包含编码信息,也可以不包含 |
Resource |
getResource()
获取资源
|
InputStream |
getStream()
获取body资源流
|
static ResourceBody |
of(HttpResource resource)
创建 Http request body
|
void |
write(OutputStream out)
写出数据,不关闭流
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontentType, getBytes, writeClosepublic ResourceBody(HttpResource resource)
resource - Body内容public static ResourceBody of(HttpResource resource)
resource - body内容public Resource getResource()
public void write(OutputStream out)
HttpBodypublic InputStream getStream()
HttpBodygetStream in interface HttpBodyInputStreampublic String contentType()
HttpBodycontentType in interface HttpBodypublic long contentLength()
HttpBodycontentLength in interface HttpBodyCopyright © 2025. All rights reserved.