code: public static int encodeSlof(
        double[] data,
        int dataSize,
        byte[] result,
        double fixedPoint
    ) {
      int x;
      int ri = 8;
  
      encodeFixedPoint(fixedPoint, result);
  
      for (int i = 0; i < dataSize; i++) {
        x = (int) (Math.log(data[i] + 1) * fixedPoint + 0.5);
  
        result[ri++] = (byte) (0xff & x);
        result[ri++] = (byte) (x >> 8);
      }
      return ri;
    }
docs: Encodes ion counts by taking the natural logarithm, and storing a fixed point representation of
  this. This is calculated as
  <p>
  unsigned short fp = log(d+1) * fixedPoint + 0.5
  <p>
  the result vector is exactly |data| * 2 + 8 bytes long
  
  @param data array of doubles to be encoded
  @param dataSize number of doubles from data to encode
  @param result array were resulting bytes should be stored
  @param fixedPoint the scaling factor used for getting the fixed point repr. This is stored in
  the binary and automatically extracted on decoding.
  @return the number of encoded bytes