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, wait
contentType, getBytes, writeClose
public ResourceBody(HttpResource resource)
resource
- Body内容public static ResourceBody of(HttpResource resource)
resource
- body内容public Resource getResource()
public void write(OutputStream out)
HttpBody
public InputStream getStream()
HttpBody
getStream
in interface HttpBody
InputStream
public String contentType()
HttpBody
contentType
in interface HttpBody
public long contentLength()
HttpBody
contentLength
in interface HttpBody
Copyright © 2025. All rights reserved.