* @param closure the closure with the input stream as parameter
* @return the original file, for chaining purpose
* @throws IOException
*/
public static AppEngineFile withInputStream(AppEngineFile file, Map<String, Object> options, Closure<?> closure) throws IOException {
FileReadChannel readChannel = FileServiceFactory.getFileService().openReadChannel(file, isLocked(options));
BufferedInputStream stream = new BufferedInputStream(Channels.newInputStream(readChannel));
IOGroovyMethods.withStream(stream, closure);
readChannel.close();
return file;
}