001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 005 package graphlab.plugins.commandline; 006 007 import java.io.BufferedReader; 008 import java.io.IOException; 009 import java.io.Reader; 010 011 /** 012 * @author Mohammad Ali Rostami 013 */ 014 public class MyReader extends Reader { 015 private BufferedReader br; 016 017 public MyReader(Reader r) { 018 br = new BufferedReader(r); 019 } 020 021 022 public int read(char cbuf[], int off, int len) throws IOException { 023 String s = br.readLine(); 024 cbuf = s.toCharArray(); 025 System.out.println(cbuf); 026 return 0; //To change body of implemented methods use File | Settings | File Templates. 027 } 028 029 public void close() throws IOException { 030 br.close(); 031 } 032 }