package tool;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class LrcReader
{
public static void main ( String args[] ) throws IOException
{
read ();
}
public static void read () throws IOException
{
String path = "一场游戏一场梦.lrc";
FileInputStream fis = null;
InputStreamReader isr = null;
FileOutputStream fos = null;
OutputStreamWriter osw = null;
try
{
fis = new FileInputStream (path);
isr = new InputStreamReader (fis, "gbk");
fos = new FileOutputStream ("恭喜发财.lrc");
osw = new OutputStreamWriter (fos, "gbk");
int size = -1;
while (( size = isr.read () ) != -1)
{
osw.write (size);
}
osw.flush ();
}
catch (IOException e)
{
System.err.println (e.toString ());
}
finally
{
if (null != osw)
{
osw.close ();
}
if (null != fos)
{
fos.close ();
}
if (null != isr)
{
isr.close ();
}
if (null != fis)
{
fis.close ();
}
}
}
}
没遇到过这种问题,而且我把你的程序在我的机器上跑了次,发现很正常,没有出现你说的问题?不清楚是不是由于你的文件的问题,或者你可以试下字节流