Alternative to properties file for reading a list?

Discussion in 'Plugin Development' started by kmccmk9, Feb 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    kmccmk9

    Hello, I know how to use property files to load variables from a document. However I am trying to load, for example, a file with every line being read into a array. How would I go about doing this? Thanks.
     
  2. Offline

    RealDope

    Google BufferedWriters and BufferedReaders
     
  3. Offline

    kmccmk9

    So I would basically use readline in a loop?
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    That is one way of doing it.
     
  5. Offline

    kmccmk9

    I'll give it a shot thanks

    One quick question, how would I determine how big the array should be?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  6. Offline

    Sagacious_Zed Bukkit Docs

    You can't determine how big it is, unless you know ahead of time how long the file is.
     
  7. Offline

    kmccmk9

    Okay and unfortunately there isn't a size command so I can't even use a dynamic array. Would it be possible to read the files into a list and then convert the list into an array or should I just set the size of the array to some arbitrary large constant like 100 or something?
     
  8. Offline

    Sagacious_Zed Bukkit Docs

    kmccmk9
    Why are you not reading it into a List?
     
  9. Offline

    kmccmk9

    I was going to read in to a array directly.
     
Thread Status:
Not open for further replies.

Share This Page