Code example for FileReader

Methods: read

0
public class TimeSeriesRendrerTest extends TestCase {
 
	public void testTimeSeriesRenderer() throws Exception 
	{ 
		FileReader reader;  
		reader = new FileReader("yrexample.xml");
        int bufferSize = 900000;
		char[] buf = new char[bufferSize];
 
		int sizeRead = reader.read(buf);
        if(sizeRead == bufferSize)
        { 
            throw new Exception("To small a buffer to read the entire xml.");
        } 
	 
		String xml = new String(buf);
        xml = xml.trim();
 
		 
		Weatherdata data = new Weatherdata(xml);