MCPcopy Index your code
hub / github.com/jankotek/mapdb / serialize

Method serialize

src/main/java/org/mapdb/IndexTreeListJava.java:17–46  ·  view source on GitHub ↗
(DataOutput2 out, long[] value)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.80
packLongArrayMethod · 0.80
writeLongMethod · 0.65

Tested by

no test coverage detected