I would like to use the CSVReader in opencsv to read a string of comma separated values. I have used this reader with a multipart file in the past wherein the following would be done: CSVReader reader = new CSVReader(new InputStreamReader(fileName.getInputStream());
This is fine for a multipart file however I cannot find a solution for this if I simply want to pass in a string e.g. one line of CSV's.
new ByteArrayInputStream(string.getBytes())basically do the job here?