Files in Java

Jayashree Jagdale, PICT, Pune

Get Started. It's Free
or sign up with your email address
Files in Java by Mind Map: Files in Java

1. File operations

1.1. read

1.2. write

1.3. append

1.4. delete

1.5. create

2. File reading operations

2.1. FileReader

2.1.1. FileReader(File file)

2.1.2. read()

2.2. BufferedReader

2.2.1. BufferedReader in = new BufferedReader(Reader in, int size);

2.2.2. readLine()

2.3. Scanner

2.3.1. Scanner s=new Scanner(file)

2.3.2. s.nextLine() / s.nextInt() / s.nextFloat() ....

2.3.2.1. s.hasNextLine()

3. Reading heirarchy

3.1. Reader

3.1.1. InptStreamReader

3.1.1.1. FileReader

3.1.2. BufferedReader

4. Write herirachy

4.1. OutputStremWriter

4.1.1. FileWriter

4.2. BufferedWriter

5. File writing operations

5.1. FileOutputStream

5.1.1. fw=new FileOutputStream(new File(filename)

5.1.2. fw.write(string.getBytes(), 0,string size);

5.2. FileWriter

5.2.1. fr = new FileWriter(file);

5.2.2. fr.write(data);

5.3. BufferedWriter

5.3.1. fr = new FileWriter(file);

5.3.2. br = new BufferedWriter(fr)

5.3.3. br.write(dataWithNewLine);

5.4. Files

5.4.1. Files.write(Paths.get(filename, data.getBytes()); // data is a string array

6. File types

6.1. Sequential access

6.2. Random access