类 InspectedContent
java.lang.Object
org.springframework.boot.buildpack.platform.io.InspectedContent
- 所有已实现的接口:
Content
Content that is reads and inspects a source of data only once but allows it to
be consumed multiple times.- 从以下版本开始:
- 2.3.0
- 作者:
- Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceInterface that can be used to inspect content as it is initially read. -
方法概要
修饰符和类型方法说明static InspectedContentof(InputStream inputStream, InspectedContent.Inspector... inspectors) Factory method to create anInspectedContentinstance from a source input stream.static InspectedContentof(Content content, InspectedContent.Inspector... inspectors) Factory method to create anInspectedContentinstance from source content.static InspectedContentof(IOConsumer<OutputStream> writer, InspectedContent.Inspector... inspectors) Factory method to create anInspectedContentinstance from a source write method.intsize()The size of the content in bytes.voidwriteTo(OutputStream outputStream) Write the content to the given output stream.
-
方法详细资料
-
size
public int size()从接口复制的说明:ContentThe size of the content in bytes. -
writeTo
从接口复制的说明:ContentWrite the content to the given output stream.- 指定者:
writeTo在接口中Content- 参数:
outputStream- the output stream to write to- 抛出:
IOException- on IO error
-
of
public static InspectedContent of(InputStream inputStream, InspectedContent.Inspector... inspectors) throws IOException Factory method to create anInspectedContentinstance from a source input stream.- 参数:
inputStream- the content input streaminspectors- any inspectors to apply- 返回:
- a new inspected content instance
- 抛出:
IOException- on IO error
-
of
public static InspectedContent of(Content content, InspectedContent.Inspector... inspectors) throws IOException Factory method to create anInspectedContentinstance from source content.- 参数:
content- the contentinspectors- any inspectors to apply- 返回:
- a new inspected content instance
- 抛出:
IOException- on IO error
-
of
public static InspectedContent of(IOConsumer<OutputStream> writer, InspectedContent.Inspector... inspectors) throws IOException Factory method to create anInspectedContentinstance from a source write method.- 参数:
writer- a consumer representing the write methodinspectors- any inspectors to apply- 返回:
- a new inspected content instance
- 抛出:
IOException- on IO error
-