return LongValue.create(dataWritten);
} finally {
os.close();
}
} catch (IOException e) {
throw new QuercusModuleException(e);
} finally {
if (s != null && (s instanceof LockableStream) &&
((flags & LOCK_EX) != 0))
flock(env, (LockableStream) s, LOCK_UN, null);
}