java 字符流与字节流互转

package test;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader; public class IOZhuanHuan { public static void main(String[] args) throws IOException {
// TODO 自动生成的方法存根
String src="你好啊!";
InputStream is=new ByteArrayInputStream(src.getBytes("utf-8"));//字符流转字节流 BufferedReader in=new BufferedReader(new InputStreamReader(is,"utf-8"));//字节转字符
System.out.println(in.readLine());
} }
上一篇:SQL注入进阶-测试及利用方法总结


下一篇:附加被分离DB