docs: public static byte[] toBytes(long value, int length) {
          if (length <= 0) return new byte[0];
          if (length > 8) length = 8;
          byte[] out = new byte[length];
          for (int i = length - 1; i >= 0; i--){
              out[i] = (byte)(value & 0xFFL);
              value = value >> 8;
          }
          return out;
      }