posted 22 years ago
As far as ordering, that's the way streams go. It's first in, first out, at least with all my experiences. For instance, if you write two ints to a stream, and then want to get one of them out, if the ints didn't leave the stream in the same order, how would the stream know what int you wanted? It's very predictable output when it comes to order.
Not sure I understand your second question. Perhaps you are using the wrong class? Do you want to deal with characters? If so, use a FileReader, not a FileInputStream. The general rule is if you are dealing with characters, do Readers. If you want bytes, do streams.
That being said, perhaps you can give a more elaborate example of the problem you are having with your second concern?