Search:

Type: Posts; User: Rexshine

Search: Search took 0.07 seconds.

  1. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    will check it tomorrow, thank u , good night
  2. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    I don't understand you at all. Do you mean this?


    static String leeLinea(BufferedReader br) throws IOException{
    char caracter = '\0';
    int esNulo = 0;
    if((esNulo = (int) br.read()) ==...
  3. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    I tried many ways but this is the best. that doesn't show first character because i do a read() at start


    static String leeLinea(BufferedReader br) throws IOException{
    //Character caracter =...
  4. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    but then i could not return last string in my example input: new StringReader("En un lugar\r\nDe la mancha"))

    i only return first line "en un lugar" but second one has append the -1 with...
  5. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    "The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached"



    Some help please. How to return the string when it find \n or when...
  6. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    it shows '-1' : System.out.println(br.read());

    oh my god, now i understand what the -1 that uses the teacher means... thank you
    this is like index -1 for string index right?

    This is right?
    ...
  7. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    I did before, i see the char '?' then i search for char ? that is 63 and tried : if (caracter == (char)63) {return null;} but doesnt work. so i made this to find the ascii code for that char...
  8. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    Ok, i know exactly what i have to do: I must simulate readLine() method, reading char by char, and returning the first String when find carriage return, and if it is the end of file, must return...
  9. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    it's how i read a line from a file, but is just an example, how should my method work.
    Anyway, if it is too hard, 100% sure i missunderstood my problem. so i ask tomorrow to my teacher. thank you...
  10. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    "Need to do a method that return a String with the next line to read from a file. When it reach the end of file , it return null instead the String."



    Should do this: without using readLine()
    ...
  11. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    he don't really say it, but it has no sense that i use readLine inside my method that simulates readLine :confused:

    I don't think i should do this


    static String leeLinea(BufferedReader br)...
  12. Replies
    24
    Views
    1,482

    Re: simulate BufferedReader's readLine()

    a

    --- Update ---


    I must return null when it reach end of file.

    I must write the code of readLine()

    My method must pass a BufferedReader as parameter.
  13. Replies
    24
    Views
    1,482

    simulate BufferedReader's readLine()

    Any idea please? I am stuck, I look at BufferedReader methods but i didn't found any useful, need to do a method that return a String with the next line to read from a file. When it reach the end of...
Results 1 to 13 of 13