private final void _writeString(char[] text,int offset,int len) throws IOException, JsonGenerationException {
  if (_characterEscapes != null) {
    _writeStringCustom(text,offset,len);
    return;
  }
  if (_maximumNonEscapedChar != 0) {
    _writeStringASCII(text,offset,len,_maximumNonEscapedChar);
    return;
  }
  len+=offset;
  final int[] escCodes=_outputEscapes;
  final int escLen=escCodes.length;
  while (offset < len) {
    int start=offset;
    while (true) {
      char c=text[offset];
      if (c < escLen && escCodes[c] != 0) {
        break;
      }
      if (++offset >= len) {
        break;
      }
    }
    int newAmount=offset - start;
    if (newAmount < SHORT_WRITE) {
      if ((_outputTail + newAmount) > _outputEnd) {
        _flushBuffer();
      }
      if (newAmount > 0) {
        System.arraycopy(text,start,_outputBuffer,_outputTail,newAmount);
        _outputTail+=newAmount;
      }
    }
 else {
      _flushBuffer();
      _writer.write(text,start,newAmount);
    }
    if (offset >= len) {
      break;
    }
    char c=text[offset++];
    _appendCharacterEscape(c,escCodes[c]);
  }
}

private final void _writeString ( char [ ] text , int offset , int len ) throws IOException , JsonGenerationException { if ( _characterEscapes != null ) { _writeStringCustom ( text , offset , len ) ; return ; } if ( _maximumNonEscapedChar != 0 ) { _writeStringASCII ( text , offset , len , _maximumNonEscapedChar ) ; return ; } len += offset ; final int [ ] escCodes = _outputEscapes ; final int escLen = escCodes . length ; while ( offset < len ) { int start = offset ; while ( true ) { char c = text [ offset ] ; if ( c < escLen && escCodes [ c ] != 0 ) { break ; } if ( ++ offset >= len ) { break ; } } int newAmount = offset - start ; if ( newAmount < SHORT_WRITE ) { if ( ( _outputTail + newAmount ) > _outputEnd ) { _flushBuffer ( ) ; } if ( newAmount > 0 ) { System . arraycopy ( text , start , _outputBuffer , _outputTail , newAmount ) ; _outputTail += newAmount ; } } else { _flushBuffer ( ) ; _writer . write ( text , start , newAmount ) ; } if ( offset >= len ) { break ; } char c = text [ offset ++ ] ; _appendCharacterEscape ( c , escCodes [ c ] ) ; } }
this method called when the string content is already in a char buffer , and need not be copied for processing .
