Skip to content

class StreamContent

cangjie
public class StreamContent <: HttpContent

功能:表示基于输入流的 HTTP 内容。

父类型:

成员概览

成员功能
init(InputStream)使用输入流创建 HTTP 内容。
func createContentReadStream()创建用于读取内容体的输入流。

init(InputStream)

cangjie
public init(stream: InputStream)

功能:使用输入流创建 HTTP 内容。

参数:

  • stream: InputStream - 要作为内容源读取的输入流。

func createContentReadStream()

cangjie
public override func createContentReadStream(): InputStream

功能:创建用于读取内容体的输入流。

返回值:

  • InputStream - 底层输入流对象。

异常:

  • Exception - 当流已被消费且不支持回绕时抛出。