Пример #1
0
    public long serializedSize(SliceQueryFilter f, int version) {
      TypeSizes sizes = TypeSizes.NATIVE;

      int size = 0;
      size += sizes.sizeof(f.slices.length);
      for (ColumnSlice slice : f.slices)
        size += type.sliceSerializer().serializedSize(slice, version);
      size += sizes.sizeof(f.reversed);
      size += sizes.sizeof(f.count);

      size += sizes.sizeof(f.compositesToGroup);
      return size;
    }
Пример #2
0
    public long serializedSize(Slices slices, int version) {
      long size = TypeSizes.sizeofVInt(slices.size());

      if (slices.size() == 0) return size;

      List<AbstractType<?>> types =
          slices instanceof SelectAllSlices
              ? Collections.<AbstractType<?>>emptyList()
              : ((ArrayBackedSlices) slices).comparator.subtypes();

      for (Slice slice : slices) size += Slice.serializer.serializedSize(slice, version, types);

      return size;
    }
Пример #3
0
 public long serializedSize(ByteBuffer bb, TypeSizes typeSizes) {
   int bbSize = bb.remaining();
   return typeSizes.sizeof((short) bbSize) + bbSize;
 }