标题: 怎样结束流? [打印本页] 作者: 吴亨 时间: 2011-12-17 20:09 标题: 怎样结束流? import java.io.*;
public class TestByteArray {
public static void main(String[] args) {
byte[] buffer = "asadhjkk".getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(buffer);
ByteArrayOutputStream out = new ByteArrayOutputStream();
transform(in,out);
transform(System.in,System.out);
}
public static void transform(InputStream in,OutputStream out)
{
int ch1 = 0;
int ch2 = 0;
try{
public static void main(String[] args) {
byte[] buffer = "asadhjkk".getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(buffer);
ByteArrayOutputStream out = new ByteArrayOutputStream();
transform(in,out);
transform(System.in,System.out);
}
public static void transform(InputStream in,OutputStream out)
{
int ch1 = 0;
int ch2 = 0;
try{