code: private static int maxLiteralLengthModulus(int n)
    {
      int m = (n & 0xC1F07C1F) + ((n >>> 5) & 0xC1F07C1F);
      m = (m >>> 15) + (m & 0x00007FFF);
      if (m <= 31) {
        return m == 31 ? 0 : m;
      }
      m = (m >>> 5) + (m & 0x0000001F);
      if (m <= 31) {
        return m == 31 ? 0 : m;
      }
      m = (m >>> 5) + (m & 0x0000001F);
      if (m <= 31) {
        return m == 31 ? 0 : m;
      }
      m = (m >>> 5) + (m & 0x0000001F);
      if (m <= 31) {
        return m == 31 ? 0 : m;
      }
      m = (m >>> 5) + (m & 0x0000001F);
      if (m <= 31) {
        return m == 31 ? 0 : m;
      }
      m = (m >>> 5) + (m & 0x0000001F);
      return m == 31 ? 0 : m;
    }
docs: Calculates the modulus division by 31 in a faster way than using <code>n % 31</code>
  <p/>
  This method of finding modulus division by an integer that is one less
  than a power of 2 takes at most <tt>O(lg(32))</tt> time. The number of operations
  is at most <tt>12 + 9 * ceil(lg(32))</tt>.
  <p/>
  See <a href="http://graphics.stanford.edu/~seander/bithacks.html">
  http://graphics.stanford.edu/~seander/bithacks.html</a>
  
  @param n number to divide
  
  @return <code>n % 31</code>