类 InspectedContent
java.lang.Object
cn.taketoday.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.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static final classInternalOutputStreamused to capture the content either as bytes, or to a File if the content is too large.static interfaceInterface that can be used to inspect content as it is initially read. -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明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.static InspectedContentof(InputStream inputStream, InspectedContent.Inspector... inspectors) Factory method to create anInspectedContentinstance from a source input stream.intsize()The size of the content in bytes.voidwriteTo(OutputStream outputStream) Write the content to the given output stream.
-
字段详细资料
-
MEMORY_LIMIT
static final int MEMORY_LIMIT- 另请参阅:
-
size
private final int size -
-
-
构造器详细资料
-
InspectedContent
InspectedContent(int size, Object content)
-
-
方法详细资料
-
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
-