class StreamTest
{
public static void main(String args[]) throws IOException
{
String ss = "abc";
byte bb[] = ss.getBytes();
//ByteArrayInputStream把字节数组当作源的输入流
ByteArrayInputStream in = new ByteArrayInputStream(bb);
int c;
//循环打印
while((c = in.read()) != -1)
System.out.print((char) c);