• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is sun.net  RSS feed

 
Costa Lamona
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
there is a java.net.HttpURLConnection; we all know what it is doing
but what is sun.net.www.protocol.http.HttpURLConnection;

When I import it sun.net.www.protocol.http,
netBeans said importing from forbidden package, what is forbidden package term mean, (I KNOW what is forbidden in English mean. )

What is this package, it gives me hard times,
when you try to cast HttpInputStream to BufferedInputStream I have


Although HttpInputStream is BufferedInputStream according to
http://nitric.com/jnp/javadoc/alphabetically/HttpInputStream.html

I think it is the same BufferedInputStream but with different class signature (I mean the classes consist of different things), if you look into that link BufferedInputStream contains a method ensureOpen(), however our
BufferedInputStream is not containing anything like that not even protected or private method (I check that).

What is that, I mean really??

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off: any package starting with sun.* is an implementation detail of Sun's JVM. They're not intended to be used directly, although you'll deal indirectly with many of them -- either behind the scenes, or as implementations of public interfaces. In general, the names mean nothing. Just because a class is named X does not necessarily mean it's related to any Java API class named X. The best policy is simply to ignore those classes, and don't try to work directly with them.

Second, that web site you point to gives Javadoc for the source code included with a rather old book. The HttpInputStream documented there is not any class that ever shipped with any JDK -- it's just on the CD that comes with that ten-year-old book! They weren't written by Sun and aren't official in any way. It's very unlikely that you have these classes in your posession, and they're definitely unrelated to the sun.net class you're fiddling with.

Finally, there is no public class named HttpInputStream in the JDK API, and there never has been! Seems like you've gotten yourself confused by Googling around. There are a lot of classes with that name mentioned on the 'Net, but all of them are part of third-party products.
 
Costa Lamona
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good advice about ignore that classes, all that missing around because I trusted a doc just because it is on Google!! and it it did not even tell me the package name. (I should sleep more)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!