本帖最后由 李娟 于 2011-12-23 23:08 编辑
class Write implements Runnable
{
private PipedOutputStream out;
Write(PipedOutputStream out)
{
this.out = out;
}
public void run()
{
try
{
System.out.println("开始写入数据,等待6秒后。");
Thread.sleep(6000); //此行报错,可是视频上能运行出来
out.write("piped lai la".getBytes());
out.close();
}
catch (IOException e)
{
throw new RuntimeException("管道输出流失败");
}
}
} |