import java.io.*;
class MyReader
{
private Reader r;
private int LineNumber;
MyReader(Reader r)
{
this.r=r;
}
public void SetLineNumber(int LineNumber)
{
this.LineNumber=LineNumber;
}
public void GetLineNumber(int LineNumber)
{
this.LineNumber=LineNumber;
}
public String ReadLine()throws IOException
{
StringBuilder sb =new StringBuilder();
int ch=0;
while((ch=r.read())!=-1)
{
if(ch=='\r')
continue;
if(ch=='\n')
return sb.toString();
sb.append((char)ch);
}
return null;
}
public void Myclose() throws IOException
{
r.close();
}
}
class MyReaderBuffer
{
public static void main(String[] args) throws IOException
{
FileReader fr = new FileReader("E:\\123.txt");
MyReader mr = new MyReader(fr);
String line = null;
while((line=mr.ReadLine())!=null)
{
System.out.println(line);
}
mr.Myclose();
}
}
为什么说我的类找不到呢
|
-
类.jpg
(16.22 KB, 下载次数: 0)
|