docs: private final void _prependOrWriteCharacterEscape(char ch, int escCode)
          throws IOException, JsonGenerationException
      {
          if (escCode >= 0) { // \\N (2 char)
              if (_outputTail >= 2) { // fits, just prepend
                  int ptr = _outputTail - 2;
                  _outputHead = ptr;
                  _outputBuffer[ptr++] = '\\';
                  _outputBuffer[ptr] = (char) escCode;
                  return;
              }
              // won't fit, write
              char[] buf = _entityBuffer;
              if (buf == null) {
                  buf = _allocateEntityBuffer();
              }
              _outputHead = _outputTail;
              buf[1] = (char) escCode;
              _writer.write(buf, 0, 2);
              return;
          }
          if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
              if (_outputTail >= 6) { // fits, prepend to buffer
                  char[] buf = _outputBuffer;
                  int ptr = _outputTail - 6;
                  _outputHead = ptr;
                  buf[ptr] = '\\';
                  buf[++ptr] = 'u';
                  // We know it's a control char, so only the last 2 chars are non-0
                  if (ch > 0xFF) { // beyond 8 bytes
                      int hi = (ch >> 8) & 0xFF;
                      buf[++ptr] = HEX_CHARS[hi >> 4];
                      buf[++ptr] = HEX_CHARS[hi & 0xF];
                      ch &= 0xFF;
                  } else {
                      buf[++ptr] = '0';
                      buf[++ptr] = '0';
                  }
                  buf[++ptr] = HEX_CHARS[ch >> 4];
                  buf[++ptr] = HEX_CHARS[ch & 0xF];
                  return;
              }
              // won't fit, flush and write
              char[] buf = _entityBuffer;
              if (buf == null) {
                  buf = _allocateEntityBuffer();
              }
              _outputHead = _outputTail;
              if (ch > 0xFF) { // beyond 8 bytes
                  int hi = (ch >> 8) & 0xFF;
                  int lo = ch & 0xFF;
                  buf[10] = HEX_CHARS[hi >> 4];
                  buf[11] = HEX_CHARS[hi & 0xF];
                  buf[12] = HEX_CHARS[lo >> 4];
                  buf[13] = HEX_CHARS[lo & 0xF];
                  _writer.write(buf, 8, 6);
              } else { // We know it's a control char, so only the last 2 chars are non-0
                  buf[6] = HEX_CHARS[ch >> 4];
                  buf[7] = HEX_CHARS[ch & 0xF];
                  _writer.write(buf, 2, 6);
              }
              return;
          }
      }