Modifier and Type | Class and Description |
---|---|
static interface |
InspectedContent.Inspector
Interface that can be used to inspect content as it is initially read.
|
Modifier and Type | Method and Description |
---|---|
static InspectedContent |
of(Content content,
InspectedContent.Inspector... inspectors)
Factory method to create an
InspectedContent instance from source content. |
static InspectedContent |
of(InputStream inputStream,
InspectedContent.Inspector... inspectors)
Factory method to create an
InspectedContent instance from a source input
stream. |
static InspectedContent |
of(IOConsumer<OutputStream> writer,
InspectedContent.Inspector... inspectors)
Factory method to create an
InspectedContent instance from a source write
method. |
int |
size()
The size of the content in bytes.
|
void |
writeTo(OutputStream outputStream)
Write the content to the given output stream.
|
public int size()
Content
public void writeTo(OutputStream outputStream) throws IOException
Content
writeTo
in interface Content
outputStream
- the output stream to write toIOException
- on IO errorpublic static InspectedContent of(InputStream inputStream, InspectedContent.Inspector... inspectors) throws IOException
InspectedContent
instance from a source input
stream.inputStream
- the content input streaminspectors
- any inspectors to applyIOException
- on IO errorpublic static InspectedContent of(Content content, InspectedContent.Inspector... inspectors) throws IOException
InspectedContent
instance from source content.content
- the contentinspectors
- any inspectors to applyIOException
- on IO errorpublic static InspectedContent of(IOConsumer<OutputStream> writer, InspectedContent.Inspector... inspectors) throws IOException
InspectedContent
instance from a source write
method.writer
- a consumer representing the write methodinspectors
- any inspectors to applyIOException
- on IO error