Redian新闻
>
guessContentTypeFromStream(InputStream)总是返回null怎么办?
avatar
guessContentTypeFromStream(InputStream)总是返回null怎么办?# Java - 爪哇娇娃
G*O
1
用到这个方法的程序在java1.4上运行可以,在1.5上不行。
自己写一个又好麻烦。
avatar
m*t
2

You know, if they were really confident on the method, they'd have named it
getContentTypeFromStream...

【在 G*O 的大作中提到】
: 用到这个方法的程序在java1.4上运行可以,在1.5上不行。
: 自己写一个又好麻烦。

avatar
c*t
3
BufferedInputStream?

【在 G*O 的大作中提到】
: 用到这个方法的程序在java1.4上运行可以,在1.5上不行。
: 自己写一个又好麻烦。

avatar
G*O
4
可是在1.4上运行的好好的。
google搜到几个bug报告竟然是2000年的,难道现在还没fix好?

it

【在 m******t 的大作中提到】
:
: You know, if they were really confident on the method, they'd have named it
: getContentTypeFromStream...

avatar
m*t
5

Did you compare the implementations between 1.4 and 1.5?
I am not really familiar with the method, but I don't necessarily think it's
so much a bug as the natural uncertainty from the "guessing content type"
business. I mean, if you read the javadoc Jamse Gosling wrote for the first
version of this method (found on google), it's pretty interesting:
"This disgusting hack is used to check for files have some type that can be
determined by inspection. The bytes at the beginning of the file are
ex

【在 G*O 的大作中提到】
: 可是在1.4上运行的好好的。
: google搜到几个bug报告竟然是2000年的,难道现在还没fix好?
:
: it

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。