@ExperimentalApi
public interface InputStreamSource
InputStream
. This interface can be conveniently passed as an argument to other methods. Passing
the InputStream
directly is confusing because it inhibits the usage of try-with-resource statement and is
sometime not clear who will be responsible for closing the stream.Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream()
Obtains an
InputStream . |
InputStream getInputStream() throws IOException
InputStream
. It is expected that each call creates a fresh stream so it is a
responsibility of the caller to close the returned stream after using it either explicitly or by using
try-with-resource statement.IOException
Copyright © 2003–2020 Atlassian. All rights reserved.