java.lang.Object
org.miaixz.bus.http.plugin.httpv.ResultBody
- All Implemented Interfaces:
CoverResult.Body
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResultBody(CoverHttp<?> coverHttp, Response response, CoverTasks.Executor executor) -
Method Summary
Modifier and TypeMethodDescriptioncache()缓存自己,缓存后可 重复使用 toXXX 类方法close()关闭报文体 未对报文体做任何消费时使用,比如只读取长度longorg.miaixz.bus.core.lang.MediaTypegetType()nextOnIO()在IO线程执行setOnProcess(Callback<Progress> onProcess) 设置报文体接收进度回调设置进度回调忽略响应的Range头信息,即进度回调会从0开始stepBytes(long stepBytes) 设置进度回调的步进字节,默认 8K(8192) 表示每接收 stepBytes 个字节,执行一次进度回调stepRate(double stepRate) 设置进度回调的步进比例 表示每接收 stepRate 比例,执行一次进度回调toArray()<T> Tbyte[]toBytes()org.miaixz.bus.core.io.ByteString下载到指定文件 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次下载到指定路径 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次下载到指定文件夹 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次下载到指定文件夹 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次<T> List<T> toString()toWapper()
-
Field Details
-
executor
-
charset
-
-
Constructor Details
-
ResultBody
-
-
Method Details
-
toWapper
- Specified by:
toWapperin interfaceCoverResult.Body- Returns:
- 消息体转 Mapper 对象(不想定义 Java Bean 时使用)
-
toArray
- Specified by:
toArrayin interfaceCoverResult.Body- Returns:
- 消息体转 Array 数组(不想定义 Java Bean 时使用)
-
toBean
- Specified by:
toBeanin interfaceCoverResult.Body- Type Parameters:
T- 目标泛型- Parameters:
type- 目标类型- Returns:
- 报文体Json文本转JavaBean
-
toList
- Specified by:
toListin interfaceCoverResult.Body- Type Parameters:
T- 目标泛型- Parameters:
type- 目标类型- Returns:
- 报文体Json文本转JavaBean列表
-
getType
public org.miaixz.bus.core.lang.MediaType getType()- Specified by:
getTypein interfaceCoverResult.Body- Returns:
- 媒体类型
-
getLength
public long getLength()- Specified by:
getLengthin interfaceCoverResult.Body- Returns:
- 报文体字节长度
-
nextOnIO
Description copied from interface:CoverResult.Body在IO线程执行- Specified by:
nextOnIOin interfaceCoverResult.Body- Returns:
- Body
-
setOnProcess
Description copied from interface:CoverResult.Body设置报文体接收进度回调- Specified by:
setOnProcessin interfaceCoverResult.Body- Parameters:
onProcess- 进度回调函数- Returns:
- Body
-
stepBytes
Description copied from interface:CoverResult.Body设置进度回调的步进字节,默认 8K(8192) 表示每接收 stepBytes 个字节,执行一次进度回调- Specified by:
stepBytesin interfaceCoverResult.Body- Parameters:
stepBytes- 步进字节- Returns:
- Body
-
stepRate
Description copied from interface:CoverResult.Body设置进度回调的步进比例 表示每接收 stepRate 比例,执行一次进度回调- Specified by:
stepRatein interfaceCoverResult.Body- Parameters:
stepRate- 步进比例- Returns:
- Body
-
setRangeIgnored
Description copied from interface:CoverResult.Body设置进度回调忽略响应的Range头信息,即进度回调会从0开始- Specified by:
setRangeIgnoredin interfaceCoverResult.Body- Returns:
- Body
-
toByteStream
- Specified by:
toByteStreamin interfaceCoverResult.Body- Returns:
- 消息体转字节流
-
toBytes
public byte[] toBytes()- Specified by:
toBytesin interfaceCoverResult.Body- Returns:
- 消息体转字节数组
-
toCharStream
- Specified by:
toCharStreamin interfaceCoverResult.Body- Returns:
- 消息体转字符流
-
toString
- Specified by:
toStringin interfaceCoverResult.Body- Overrides:
toStringin classObject- Returns:
- 消息体转字符串
-
toByteString
public org.miaixz.bus.core.io.ByteString toByteString()- Specified by:
toByteStringin interfaceCoverResult.Body- Returns:
- ByteString
-
toFile
Description copied from interface:CoverResult.Body下载到指定路径 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次- Specified by:
toFilein interfaceCoverResult.Body- Parameters:
filePath- 目标路径- Returns:
- 下载过程 #Download
-
toFile
Description copied from interface:CoverResult.Body下载到指定文件 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次- Specified by:
toFilein interfaceCoverResult.Body- Parameters:
file- 目标文件- Returns:
- 下载过程 #Download
-
toFolder
Description copied from interface:CoverResult.Body下载到指定文件夹 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次- Specified by:
toFolderin interfaceCoverResult.Body- Parameters:
dirPath- 目标目录- Returns:
- 下载过程 #Download
-
toFolder
Description copied from interface:CoverResult.Body下载到指定文件夹 同一个 Body 对象的 toXXX 类方法只可使用一个并且只能调用一次- Specified by:
toFolderin interfaceCoverResult.Body- Parameters:
dir- 目标目录- Returns:
- 下载过程 #Download
-
cache
Description copied from interface:CoverResult.Body缓存自己,缓存后可 重复使用 toXXX 类方法- Specified by:
cachein interfaceCoverResult.Body- Returns:
- Body
-
close
Description copied from interface:CoverResult.Body关闭报文体 未对报文体做任何消费时使用,比如只读取长度- Specified by:
closein interfaceCoverResult.Body- Returns:
- Body
-