src/org/kocakosm/pitaya/io/XFiles.java
public static BufferedOutputStream newOutputStream(File f, WriteOption... options)
		throws IOException
	{
		Set<WriteOption> opts = ImmutableSet.of(options);
		checkWriteOptions(opts);
		checkFileExistence(f, opts);
		return new BufferedOutputStream(newOutputStream(f, opts));
	}
public static BufferedOutputStream newOutputStream(File f, WriteOption... options)
		throws IOException
	{
		Set<WriteOption> opts = ImmutableSet.of(options);
		checkWriteOptions(opts);
		checkFileExistence(f, opts);
		return new BufferedOutputStream(newOutputStream(f, opts));
	}
public static BufferedOutputStream newOutputStream ( File f , WriteOption ... options ) throws IOException { Set < WriteOption > opts = ImmutableSet . of ( options ) ; checkWriteOptions ( opts ) ; checkFileExistence ( f , opts ) ; return new BufferedOutputStream ( newOutputStream ( f , opts ) ) ; }
Returns an {@code OutputStream} to write to the given {@code File}.

@param f the file to write to.
@param options the write options.

@return an {@code OutputStream} to write to the given {@code File}.

@throws NullPointerException if one of the arguments is {@code null}.
@throws IllegalArgumentException if incompatible options are given.
@throws FileNotFoundException if {@code f} exists but is a directory
rather than a regular file, or if it does not exist but cannot
be created, or if it cannot be opened for any other reason.
@throws IOException if the {@link WriteOption#CREATE} option is given
and the specified file already exists.
@throws SecurityException if a security manager exists and denies
write access to {@code f}.
Returns an { @code OutputStream } to write to the given { @code File } .