public int available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.
请注意下面这句话:
The available method for class InputStream always returns 0.
如果你想看输入流的大小,就用read()方法把数据读到一个byte[]中,然后看它数组的大小.
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.
请注意下面这句话:
The available method for class InputStream always returns 0.
如果你想看输入流的大小,就用read()方法把数据读到一个byte[]中,然后看它数组的大小.
解决方案 »
- 公司的java项目把99.5%以上的业务逻辑都写在Action里面,太杯具了
- My Sql 的数据库连接问题
- JAVA主要会什么?公司需要什么样的人才?SHH要学到什么程度?
- 想用mina实现嵌入网叶客服聊天的功能,高手指点指点,我没有分可给了
- 使用JavaBean错误
- hibernate的lazy加载,为什么控制台都打印出来加载完成,而又取不到呢?
- struts中的errors信息和message的信息如何通过javascript提取?
- 急需java中实现多种加密方法方面的文章!
- 会话bean调用实体bean出错,请帮忙看看!!
- j2ee服务启动不了!
- 如何访问*.properties文件???
- 为什么我把lomboz目录放到Eclipse的plugins目录下,Eclipse找不到lomboz插件呢
InputStreamReader aa = new InputStreamReader(ps.getOutputStream());
throws IOException
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread. The available method for class InputStream always returns 0. <---------看!This method should be overridden by subclasses. 必须用他的继承类才可以!否则总是返回0!!
vt.
制服, 践踏, 奔越过, 蹂躏, 不顾, 不考虑(某人的意见,决定,愿望等)
n.
代理佣金
综合楼上几位大哥的意见,终于解决了,高兴!方法如下:
String cmd="";
cmd="exp test/test@ning file=c:\1.dmp";
Runtime runtime=Runtime.getRuntime();
try
{
aa=ps.getInputStream();
BufferedReader it=new BufferedReader(new InputStreamReader(aa));
String haha="";
while((haha=it.readLine())!=null)
{
System.out.println(haha);
}}catch(IOException ex)
{
System.out.println("Exception =====>"+ex.toString());
}