(DataOutput2 out, long[] value)
| 15 | |
| 16 | static final Serializer<long[]> dirSer = new Serializer<long[]>() { |
| 17 | @Override |
| 18 | public void serialize(DataOutput2 out, long[] value) throws IOException { |
| 19 | |
| 20 | if(CC.ASSERT){ |
| 21 | int len = 2 + |
| 22 | 2*Long.bitCount(value[0])+ |
| 23 | 2*Long.bitCount(value[1]); |
| 24 | |
| 25 | if(len!=value.length) |
| 26 | throw new DBException.DataCorruption("bitmap!=len"); |
| 27 | } |
| 28 | |
| 29 | out.writeLong(value[0]); |
| 30 | out.writeLong(value[1]); |
| 31 | |
| 32 | if(value.length==2) |
| 33 | return; |
| 34 | value = value.clone(); |
| 35 | |
| 36 | long prev = value[3]; |
| 37 | |
| 38 | //every second value is Index, those are incrementing and can be delta packed |
| 39 | for(int i=5;i<value.length;i+=2){ |
| 40 | long old = value[i]; |
| 41 | value[i] = old-prev; |
| 42 | prev = old; |
| 43 | } |
| 44 | |
| 45 | out.packLongArray(value, 2, value.length); |
| 46 | } |
| 47 | |
| 48 | |
| 49 | @Override |
nothing calls this directly
no test coverage detected