Hi Marlene! From
testing it seems that the two are indeed related. Reading from the RAF seems to advance the file positoin read by the input stream, and vice versa. However I haven't seen any documentation about this. I would guess that this is undocumented behavior, and so it's probably a good idea to avoid code that uses multiple streams and RAFs referring to the same file simultaneously, unless you find explicit documentation somewhere.
In contrast, if you use a FileChannel obtained by the getChannel() method of RAF or a file input or output stream, you do get some explicit guarantees about its behavior relative to the RAF/stream, as well as relative to other FileChannels. There are still some annoying loopholes IMO in terms of shat's guaranteed here and what's not (see
this lengthy discussion if you're curious) - but the situation is certainly better than that you originally described, for which there seem to be
no guarantees. Unless I missed someting which is entirely possible. Hope that helps...