URLConnection.guessContentTypeFromStream() does not support UTF8 and UTF32 with BOM

Charles Lee littlee at linux.vnet.ibm.com
Sun Mar 6 22:57:32 PST 2011


On 03/04/2011 07:13 PM, Alan Bateman wrote:
> Charles Lee wrote:
>> Hi Alan,
>>
>> Sorry for the late reply. This test case comes from a big test case, 
>> which test more types of stream. 
> A test for this method should pass if "null" is returned as the method 
> does not specify the content types that it recognizes. I think it's 
> okay to extend it as you are proposing but I don't think anyone can 
> really rely on it. I'm happy to create an request-for-feature (RFE) in 
> the bug database for this and help you get it in if you want to pursue it.
>
> -Alan
Thanks Alan. I am so confused the hard-coding in that method. It shows 
it can only detect the a small range of type. Should some comment add on 
the spec, such as "can not be relied"?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20110307/0dfc922b/attachment.html 


More information about the net-dev mailing list