CSV: readFromFile() hinzugefügt

thobaben_serialize
Harald Wolff 2014-02-02 13:41:52 +01:00
parent 9804dbd2ad
commit c0e197be91
1 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package org.hwo.csv;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@ -89,6 +90,17 @@ public class CSV {
lastChar = ch;
}
public void readFromFile(String filename)
{
try {
readFromStream(new FileInputStream(filename));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void readFromStream(InputStream is) throws IOException
{
this.readFromStream(new InputStreamReader(is,"ISO-8859-1"));