Java DataInputStream Create getInputStream(String path)

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

Description

Opens an input stream for the specified path.

License

Apache License

Parameter

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

Exception

Parameter Description
FileNotFoundException an exception

Return

The input stream.

Declaration

public static DataInputStream getInputStream(String path) throws FileNotFoundException 

Method Source Code


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

import java.io.*;

public class Main {
    /**//from ww  w .  j a  v  a  2  s . c om
     * Opens an input stream for the specified path.
     *
     * @param path File path where input stream is to be opened.
     * @return The input stream.
     * @throws FileNotFoundException
     */
    public static DataInputStream getInputStream(String path) throws FileNotFoundException {
        return new DataInputStream(new FileInputStream(path));
    }
}

Related

  1. getInputStream(String file)
  2. getReaderFor(File file)