us.ihmc.simulationconstructionset.util.SimpleFileReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simulation-construction-set
Show all versions of simulation-construction-set
Simulation Construction Set
package us.ihmc.simulationconstructionset.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class SimpleFileReader
{
BufferedReader fileIn = null;
FileReader read;
public SimpleFileReader(File file)
{
try
{
read = new FileReader(file);
fileIn = new BufferedReader(read);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
public String nextLine()
{
try
{
return fileIn.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
return null;
}
public void close()
{
try
{
if (fileIn != null)
fileIn.close();
}
catch (IOException e)
{
System.out.println(e);
}
}
}