FileInputStream fis = new FileInputStream(strSourceFileName);
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream in = new DataInputStream(bis);
PrintWriter printWriter = new PrintWriter(outStream,true); while(true)
{
String strFile = in.readLine();
if (strFile!=null)
{ //这里就是处理中文问题过程;
strFile = new String(strFile.getBytes("iso-8859-1"),"GBK");
printWriter.println(strFile);
}else break;
}
printWriter.println("~END~");
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream in = new DataInputStream(bis);
PrintWriter printWriter = new PrintWriter(outStream,true); while(true)
{
String strFile = in.readLine();
if (strFile!=null)
{ //这里就是处理中文问题过程;
strFile = new String(strFile.getBytes("iso-8859-1"),"GBK");
printWriter.println(strFile);
}else break;
}
printWriter.println("~END~");
解决方案 »
- java.util.ConcurrentModificationException List问题
- javax.naming 问题
- 新手请教数组问题~!!
- JAVA程序员应该掌握哪些技术,年薪多少?
- Java操作Oracle游标结果累加的问题?
- 请问自己写的类放在package中如何调用,详情请您进来看看,谢谢啊^________^
- 请帮忙想想,如何用JAVA生成一个ACCESS数据库,(十万火急)
- 请问各位高手:如何把一个HTML文件转换成纯文本文件?(尽量保证显示格式)
- 请教,如果选出数据库中一条记录(比如一万条中的第3000条)
- 应该怎么样将一个对象放入到数据库里?还有怎么将图片放进数据库?急~~
- 请问如何用java实现类似于c中的传引用参数的函数
- 请问JSSE的问题
JAVA把双字节的中文字符当成单字节来发送的。
InputStream in = incoming.getInputStream();
byte b[] = new byte[buffer];
in.read(b, offset, length);byte b[]中就是所要的