Java FileOutputStream Create getOutputStream(String path)

Here you can find the source of getOutputStream(String path)

Description

Opens an output stream for the specified path.

License

Apache License

Parameter

Parameter Description
path File path where output stream is to be opened.

Exception

Parameter Description
FileNotFoundException an exception

Return

The output stream.

Declaration

public static DataOutputStream getOutputStream(String path) throws FileNotFoundException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    /**//from w  w  w  . ja v a2s . c om
     * Opens an output stream for the specified path.
     *
     * @param path File path where output stream is to be opened.
     * @return The output stream.
     * @throws FileNotFoundException
     */
    public static DataOutputStream getOutputStream(String path) throws FileNotFoundException {
        return new DataOutputStream(new FileOutputStream(path));
    }
}

Related

  1. getOutputStream(String filename)
  2. getOutputStream(String filename, Map map)
  3. getOutputStream(String filename, String dir)
  4. getOutputStream(String fname, String enc, boolean append)
  5. getOutputStream(String path)
  6. getOutputStream(String root, String name, boolean overwrite, boolean verbose)
  7. getOutputStream(String theFilePath)
  8. getOutputStreamForFile(final File file)
  9. getOutputStreamForFile(String filename)