value是有值的
String value = "1";
if (value != null) {
InputStream stream = this.getClass().getResourceAsStream(value);
System.out.print(stream);
if (stream == null) {
throw new IOException(UNABLE_TO_FIND_BINARY_RESOURCE);
}
出现以下异常:stream为什么是空的 出现nullException 异常
String value = "1";
if (value != null) {
InputStream stream = this.getClass().getResourceAsStream(value);
System.out.print(stream);
if (stream == null) {
throw new IOException(UNABLE_TO_FIND_BINARY_RESOURCE);
}
出现以下异常:stream为什么是空的 出现nullException 异常
解决方案 »
- 连接oracle,Cannot create PoolableConnectionFactory
- 求大神指点 用java编写一个下载在线漫画网站上的漫画的程序。
- Spring框架中关于IOC的问题
- hinernate高手进啊 在线等
- 谁能写一个简单的线程死锁出来
- 请教关于shell执行jar包问题
- 会javamail的高手请进来帮帮我
- 工作不会做,每天烦躁,何去何从,去培训吗?
- java版微信开发
- 请帮我看看axis里用Vector封状自定义对象的问题
- 怎么动态 加载一个方法 加载到ApplicationContext上下文中
- 急!spring3 整合struts2 错误! [Java Java EE]
下面。。this.getClass().getResourceAsStream(value);。。这个是加载外部文件用的。。
我不知道STREAM可以不可以直接OUT- -
直接 value .getBytes() 不就完了
if (value != null) {
InputStream stream = this.getClass().getResourceAsStream(value);
System.out.print(stream);
if (stream == null) {
throw new IOException(UNABLE_TO_FIND_BINARY_RESOURCE);
}
出现以下异常:stream为什么是空的 出现nullException 异常
然后你就知道为什么你传“1”进去是不行的。。
三楼已经说的很明白了