Currently, via a singleton class, I use one FileInputStream for accessing my data file. I plan to implement my criteria find method by loading all the records into a cache who's scope is local to the criteria find method. Because I don't want to fool around with the main FileInputStream's position. I create a FileInputStream that is local to the criteria find method. Does this seem okay? Or is there some reason why I shouldn't create a FileInputStream local to the method?
town drunk ( and author)
posted 14 years ago
It seems ok to me. You run the risk of dirty reads, but that's always a risk, unless you lock before reading. the subject of your post indicated that you had a question about FileChannels? Do you know how to use them for this purpose? M, author The Sun Certified Java Developer Exam with J2SE 1.4