vendredi 24 juillet 2015

JAVA - How can i read random proxys from txt?

i have a File.txt in mi pc, so i know how read it sequentially using this simple method:

FileReader  fl = new FileReader("C:/Users/Silver/Desktop/proxy.txt");
        BufferedReader br = new BufferedReader(fl);

        for(;;){
        String read = br.readLine();    
        System.out.println(read);
            Thread.sleep(100);
            if (read == null) {
                System.out.println("No More proxys");
                br.close();
            }

And this read until there are no more proxys, so i wanna know an easy method to do the same but this time randomly, i read about a method called "LineNumberReader" somebody that know about this can explain to me?

Thanks so much.




Aucun commentaire:

Enregistrer un commentaire