int (char c, @NotNull String s, int index, @NotNull StringBuilder out) { char startC = c; int v = c - '0'; if (index < s.length()) { c = s.charAt(index++); if ('0' <= c && c <= '7') { v <<= 3; v += c - '0'; if (startC <= '3' && index < s.length()) { c = s.charAt(index++); if ('0' <= c && c <= '7') { v <<= 3; v += c - '0'; } else { index--; } } } else { index--; } } out.append((char)v); return index; }