2012年12月3日

guessContentTypeFromStream

摘要: 先贴段 guessContentTypeFromStream 实现代码感觉只判断前几个字节的话,还是有点问题的比如我一个txt文本以RIFF开头就会被判别成audio/x-wav总之有点不够严谨,但一般情况下应该是够用了staticpublicString guessContentTypeFromStream(InputStream is)throwsIOException {// If we can't read ahead safely, just give up on guessingif(!is.markSupported())returnnull;is.mark(12);in 阅读全文

posted @ 2012-12-03 18:39 luckistmaomao 阅读(500) 评论(0) 推荐(0) 编辑

导航