class InputStreamExtensions extends Object
Extensions to Java's InputStream classes.
| Constructor and description |
|---|
InputStreamExtensions() |
| Type Params | Return Type | Name and description |
|---|---|---|
<I extends InputStream, T> |
static T |
markAndReset(I self, int readLimit, Closure<T> closure)Convenience method for calling InputStream.mark, executing the closure, and then calling InputStream.reset before returning. |
<T> |
static T |
withBufferedReader(InputStream self, Closure<T> closure)Ensure an input stream is a BufferedInputStream, wrapping it in one if necessary, before invoking the usual withReader method over it. |
<T> |
static T |
withBufferedStream(InputStream self, Closure<T> closure)Ensure an input stream is a BufferedInputStream, wrapping it in one if necessary, before invoking the usual withStream method over it. |
Convenience method for calling InputStream.mark, executing the closure, and then calling InputStream.reset before returning.
Ensure an input stream is a BufferedInputStream, wrapping it in one
if necessary, before invoking the usual withReader method over it.
Ensure an input stream is a BufferedInputStream, wrapping it in one
if necessary, before invoking the usual withStream method over it.