forked from LupusNobilis/java-org.hwo
CSV: readFromFile() hinzugefügt
parent
9804dbd2ad
commit
c0e197be91
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue