[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
courses:mapreduce-tutorial:step-27 [2012/01/28 20:14]
straka
courses:mapreduce-tutorial:step-27 [2012/01/29 16:18]
straka
Line 24: Line 24:
  
   public void write(DataOutput out) throws IOException {   public void write(DataOutput out) throws IOException {
-    int highest_pos = 28; +    int mask_shift = 28; 
-    while (highest_pos > 0 && (value & (0x7F << highest_pos)) == 0) highest_pos -= 7; +    while (mask_shift > 0 && (value & (0x7F << mask_shift)) == 0) mask_shift -= 7; 
-    while (highest_pos > 0) { +    while (mask_shift > 0) { 
-      out.writeByte(0x80 | ((value >> highest_pos) & 0x7F)); +      out.writeByte(0x80 | ((value >> mask_shift) & 0x7F)); 
-      highest_pos -= 7;+      mask_shift -= 7;
     }     }
     out.writeByte(value & 0x7F);     out.writeByte(value & 0x7F);

[ Back to the navigation ] [ Back to the content ]