Java BufferedReader Read All readAllCourseNum()

Here you can find the source of readAllCourseNum()

Description

read All Course Num

License

Open Source License

Declaration

public synchronized static Vector<String> readAllCourseNum() throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;

public class Main {
    public synchronized static Vector<String> readAllCourseNum() throws IOException {
        File file = new File("D:\\CourseSystemDB\\courseList.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
        String line;/* ww  w .j a v  a  2s . c  o  m*/
        Vector<String> v = new Vector<String>();
        while ((line = reader.readLine()) != null) {
            String[] temp = line.split("  ");
            v.addElement(temp[0]);
        }
        reader.close();
        return v;
    }
}

Related

  1. readAll(String filePath)
  2. readAll(String filePathAndName)
  3. readAll(String ip)
  4. readAll(String path)
  5. ReadAll_Variant2(Reader rd, Writer wr)
  6. readAllCoursePro()
  7. readAllCourseTime()
  8. readAllFromInputStream(InputStream inputStream)
  9. readAllFromInputStreamAsList(InputStream inputStream)