H
HowTo
Hello,
I just ran into a probelm when reading a binary file.
The binary file contains a bunch of data which are to be assigned to
different buffers.
Now, there are occassions where a single byte of the file needs to be
twice, as it contains part of information for buffer A and another
part of information for buffer B - I know its stupid, but I didn't
design the file layout, I only have to somehow parse it....
Anyway, I use the FileInputStream class for reading the binary file
and that normally works fine. However the read (byte[], offset,
length) routine, does not really seems to position at the given
offset ... at least it does not seem to make any diffrence if I insert
(offset -1), (offset) or (offset+1).
Now, did anyone already experience a similar problem? And if you did,
how did you solve it?
Many thanks in advance
I just ran into a probelm when reading a binary file.
The binary file contains a bunch of data which are to be assigned to
different buffers.
Now, there are occassions where a single byte of the file needs to be
twice, as it contains part of information for buffer A and another
part of information for buffer B - I know its stupid, but I didn't
design the file layout, I only have to somehow parse it....
Anyway, I use the FileInputStream class for reading the binary file
and that normally works fine. However the read (byte[], offset,
length) routine, does not really seems to position at the given
offset ... at least it does not seem to make any diffrence if I insert
(offset -1), (offset) or (offset+1).
Now, did anyone already experience a similar problem? And if you did,
how did you solve it?
Many thanks in advance