"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:Oc**************@TK2MSFTNGP04.phx.gbl...
Why/how are you using a BinaryReader? To simply read a byte stream from a
file, you should simply use the Read function on a Stream object (most
likely, a FileStream, since you say you're reading a file). You don't
need to use any kind of "reader" to read uninterpreted bytes from a
stream.
OK. I just ditched the BinaryReader.
Not sure why I was using it in the first place, it just seemed like an easy
solution. :)
I'm now using the Read method from FileStream.
However, it still doesn't work right and it looks like the bytes are
different.
Here is the very end of the same file. For example, in C# the byte is 170,
in Java it is -86
Reading bytes using C#:
255 250 56 192 221 50 230 128 20 237 31 105 185
156 0 17 88 14 222 135 178 240 0 170 170 170 170 170 170 170 170 170 170 170
1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
170 1
70 170 84 65 71 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 3
2 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 3
2 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 0
Reading bytes in Java:
-1 -6 56 -64 -35 50 -26 -128 20 -19 31 105 -71 -100 0 17 88
14 -34 -121 -78 -16
0 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86 -86
-86 -86 -86 84 65 71 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
32 32 32 32 32 32 0