ctf: fix windows regression
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 19 May 2015 16:04:02 +0000 (12:04 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Tue, 19 May 2015 18:04:30 +0000 (14:04 -0400)
In windows, the bitbuffer reads the filechannel. This advances the
position. It needs to be flip()ed to reset reading. This problem will
be obvious when we do CI in windows.

Change-Id: Id1cbf581c993038c54d8aa6fd3a62a77e17f17e3
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/48199
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/SafeMappedByteBuffer.java

index 712df1828f23aeb1182022e9a78d466bbc12152f..7f25796d883d104aa46e2bd3a2d523b0d0c11e1d 100644 (file)
@@ -51,6 +51,7 @@ public class SafeMappedByteBuffer {
         if (IS_WIN32) {
             byteBuffer = ByteBuffer.allocate((int) size);
             fc.read(byteBuffer, position);
+            byteBuffer.flip();
         } else {
             byteBuffer = fc.map(mode, position, size);
         }
This page took 0.027361 seconds and 5 git commands to generate.