) ) ) )
) ) ) )
) ) ) )
) ) ) )
Originally posted by Layne Lund:
Alternatively, you could look at java.io.DataInputStream which can give you primitive data types directly from the input stream. To create a DataInputStream, you will probably want to use the constructor that takes an InputStream. This is what is commonly known as the Decorator pattern. You decorate InputStreams with other InputStreams to add certain functionality. In this case, it would look something like this:
The whole java.io package is a little daunting, but it is VERY flexible for many tasks. In the above example, the BufferedInputStream isn't strictly necessary, but it will improve performance slightly since it buffers the data from the FileInputStream and passes it along as necessary to the DataInputStream which is responsible for converting it into primitive data types.
HTH
Layne
James Carman, President<br />Carman Consulting, Inc.
API means Application Programming Interface and is just a fancy-pants way of saying "the public methods for a class" in this context. The API of all classes provided by Sun is referred to as the standard JavaDocs and should become your best friend when learning and using Java.Originally posted by Rose Evans:
Never even heard of API
) ) ) )
Never even heard of API...but I'll take a peek at it. Thanks!
) ) ) )
) ) ) )
) ) ) )
) ) ) )
Originally posted by Rose Evans:
Wow! You guys are certainly smart!!! Question??...Do you guys do Java as a living? I mean are you programmers, or is it a hobby, something you just wanted to learn? I am totally impressed with all of your knowledge....
And another question...how long did it take you to learn all the things you know? I know programming is a daily learning experience.
My hat is off to you all!!!
Originally posted by James Carman:
The whole java.io package is a little daunting, but it is VERY flexible for many tasks. In the above example, the BufferedInputStream isn't strictly necessary, but it will improve performance slightly since it buffers the data from the FileInputStream and passes it along as necessary to the DataInputStream which is responsible for converting it into primitive data types.
HTH
Layne<hr></blockquote>
Layne,
The DataInputStream class is for binary input (reads 4 bytes for ints) rather than textual, which is what it looks like we're dealing with here.
Jim[/QB]
) ) ) )
) ) ) )