code: static int encodedBufferSize(int len, boolean breakLines) {
          // Cast len to long to prevent overflow
          long len43 = ((long) len << 2) / 3;
  
          // Account for padding
          long ret = (len43 + 3) & ~3;
  
          if (breakLines) {
              ret += len43 / MAX_LINE_LENGTH;
          }
  
          return ret < Integer.MAX_VALUE ? (int) ret : Integer.MAX_VALUE;
      }
docs: package-private for testing