Difference between openDataInputStream and openInputStream

Hey,What is the difference between openDataInputStream() and openInputStream() when called from an HTTPConnection ?
[129 byte] By [elfalee3a] at [2007-11-27 4:07:41]
# 1

I don't really know about this but I would hazard a guess and say that one returns a DataInputStream ( http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInputStream.html ) and the other a InputStream ( http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html ) ?

And what do you mean when called from an HTTPConnection?

nogoodatcodinga at 2007-7-12 9:12:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Im actually opening a HTTP connection and then opening an inputstream, now u can open either an inputStream or a dataInputStream.

Actually my question was what is the difference between an inputstream and a dataInputStream. The java.sun website doesn't really point out the difference and the advantage of each.

Thanks for the quick reply.

elfalee3a at 2007-7-12 9:12:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
The doc actually tells you everything. DataInputStream gives you more methods like readShort, readInt, readLong, etc. InputStream doesn't.
jonathan.lea at 2007-7-12 9:12:59 > top of Java-index,Java Mobility Forums,Java ME Technologies...