Code example for FileReader

0
public final class TextFromFileCreator implements Creator<File, Text> { 
 
    @Override 
    public Text create(final File source) { 
        try { 
            return new Text(new FileReader(source)); 
        } 
        catch (FileNotFoundException e) { 
            throw new IllegalArgumentException("Cannot create Text", e); 
        } 
    } 
}