2010-02-03, 02:16 AM
(This post was last modified: 2010-02-03, 02:19 AM by KajitiSouls.)
Mmm yes Java...
I have a problem with my code, named Browser. It's basically a sophisticated object that can hold another instance of itself. In that sense, it's kinda like a linked list object. One of its nonstatic properties is a FileInputStream, and the way it is built right now, they're all suppose to go to the same file the original Browser was instantiated for. However, each FileInputStream is suppose to be able to work independently of each other, or that's the theory anyways.
Now here's the problem: these FileInputStreams are behaving in a rather unexpected way. At some point shortly after the next Browser object in the chain is created, something fks up and its FileInputStream somehow ends up 10 bytes behind the expected position. Is there something about these input streams that I should know about?
The code that seems to bring up the most of this strange error:
Code here (site seems to be plagued with popups lately). Certain parts are edited due to confidentiality reasons. Of particular interest are methods navigateTo, the various read methods at the bottom, and lookIn. The read methods were copy pasta from previous projects that have proven themselves to work, so I highly doubt those are the problem, but then again one never knows. The two places where the problems start occurring are at lines 66 and 119.
I have a problem with my code, named Browser. It's basically a sophisticated object that can hold another instance of itself. In that sense, it's kinda like a linked list object. One of its nonstatic properties is a FileInputStream, and the way it is built right now, they're all suppose to go to the same file the original Browser was instantiated for. However, each FileInputStream is suppose to be able to work independently of each other, or that's the theory anyways.
Now here's the problem: these FileInputStreams are behaving in a rather unexpected way. At some point shortly after the next Browser object in the chain is created, something fks up and its FileInputStream somehow ends up 10 bytes behind the expected position. Is there something about these input streams that I should know about?
The code that seems to bring up the most of this strange error:
Code:
Browser browse = new Browser(stuuufffff);
browse.lookIn("cash"); //sometimes screws up, depending on edits.
browse.back();
browse.lookIn("cash"); //WILL screw up!Code here (site seems to be plagued with popups lately). Certain parts are edited due to confidentiality reasons. Of particular interest are methods navigateTo, the various read methods at the bottom, and lookIn. The read methods were copy pasta from previous projects that have proven themselves to work, so I highly doubt those are the problem, but then again one never knows. The two places where the problems start occurring are at lines 66 and 119.

