Convert java Reader object into a char Array -- Need Help!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madumm
    New Member
    • Jan 2007
    • 18

    #1

    Convert java Reader object into a char Array -- Need Help!!!

    Hi all;

    I hv a Reader object say;

    Reader r;
    r =.............. .;


    I need this reader object to be converted into a character array.
    ............... ............... ............... ............... ............... ............... ...............
    Can u pls give your ideas!
    your help will be greatly appreciated :)

    regards
    madumm
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Originally posted by madumm
    Hi all;

    I hv a Reader object say;

    Reader r;
    r =.............. .;


    I need this reader object to be converted into a character array.
    ............... ............... ............... ............... ............... ............... ...............
    Can u pls give your ideas!
    your help will be greatly appreciated :)

    regards
    madumm
    Hi there,

    looks like you need a loop within your code, i.e.

    convert reader data to string 'toSring()', and then loop through that string one char at a time and add that to an array (if that is what you mean) i.e.

    FOR i = 0; i = myString.Length
    ADD char at myString.Positi on[i]
    TO myArray at position [i]

    or something like that (NB that is pseudo code.. not actual java)

    Comment

    • madumm
      New Member
      • Jan 2007
      • 18

      #3
      Originally posted by markmcgookin
      Hi there,

      looks like you need a loop within your code, i.e.

      convert reader data to string 'toSring()', and then loop through that string one char at a time and add that to an array (if that is what you mean) i.e.

      FOR i = 0; i = myString.Length
      ADD char at myString.Positi on[i]
      TO myArray at position [i]

      or something like that (NB that is pseudo code.. not actual java)

      No it won't solve like that; anyway i tried :(

      Comment

      Working...