private OutputStream getOutputStream() throws IOException {
        if (outputStream == null) {
            if (closed) {
                throw new IOException("stream closed");
            }
            outputStream = new BufferedOutputStream(Files.newOutputStream(lockFile),
                    FileSystemUtil.STREAM_BUFFER_SIZE);
            streamCloser.add(outputStream);
        }
        return outputStream;
    }
Output stream that writes a lock file with the data and then renames to the
final file once closed.
<p>
If lazy is set on it also does not create the file until some data is written
(thus the file does not exist if no data was written).
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/LockingFileOutputStream.java