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. Write herirachy

1.1. OutputStremWriter

1.1.1. FileWriter

1.2. BufferedWriter

2. File writing operations

2.1. FileOutputStream

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

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

2.2. FileWriter

2.2.1. fr = new FileWriter(file);

2.2.2. fr.write(data);

2.3. BufferedWriter

2.3.1. fr = new FileWriter(file);

2.3.2. br = new BufferedWriter(fr)

2.3.3. br.write(dataWithNewLine);

2.4. Files

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

3. File types

3.1. Sequential access

3.2. Random access

4. File operations

4.1. read

4.2. write

4.3. append

4.4. delete

4.5. create

5. File reading operations

5.1. FileReader

5.1.1. FileReader(File file)

5.1.2. read()

5.2. BufferedReader

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

5.2.2. readLine()

5.3. Scanner

5.3.1. Scanner s=new Scanner(file)

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

5.3.2.1. s.hasNextLine()

6. Reading heirarchy

6.1. Reader

6.1.1. InptStreamReader

6.1.1.1. FileReader

6.1.2. BufferedReader