Package com.atlassian.jira.util.io
Interface InputStreamConsumer<T>
- Type Parameters:
T-
- All Known Implementing Classes:
AttachmentZipEntryStreamConsumer
@PublicSpi
public interface InputStreamConsumer<T>
Implementors consume an
InputStream.
Typical usage pattern for methods that accept a consumer is to pass in an anonymous implementation of this interface:
something.withConsumer(new InputStreamConsumer(){
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptiondefault TwithInputStreamAndLength(InputStream is, Long length) Consume anInputStreamwith an optional length provided.
-
Method Details
-
withInputStream
- Throws:
IOException
-
withInputStreamAndLength
default T withInputStreamAndLength(@Nonnull InputStream is, @Nullable Long length) throws IOException Consume anInputStreamwith an optional length provided.- Parameters:
is- theInputStreamto consumelength- the length of the stream in bytes, if known- Throws:
IOException- Since:
- 9.13
-