fun StringDict(reader: BufferedReader?) { val lines: Array<String> = PApplet.loadStrings(reader) keys = arrayOfNulls<String>(lines.size) values = arrayOfNulls<String>(lines.size) for (i in lines.indices) { val pieces: Array<String> = PApplet.split(lines[i], '\t') if (pieces.size == 2) { keys.get(count) = pieces[0] values.get(count) = pieces[1] count++ } } }
Read a set of entries from a Reader that has each key/value pair on a single line , separated by a tab .