private final void _writeStringSegments(String text) throws IOException, JsonGenerationException {
  int left=text.length();
  int offset=0;
  final char[] cbuf=_charBuffer;
  while (left > 0) {
    int len=Math.min(_outputMaxContiguous,left);
    text.getChars(offset,offset + len,cbuf,0);
    if ((_outputTail + len) > _outputEnd) {
      _flushBuffer();
    }
    _writeStringSegment(cbuf,0,len);
    offset+=len;
    left-=len;
  }
}

private final void _writeStringSegments ( String text ) throws IOException , JsonGenerationException { int left = text . length ( ) ; int offset = 0 ; final char [ ] cbuf = _charBuffer ; while ( left > 0 ) { int len = Math . min ( _outputMaxContiguous , left ) ; text . getChars ( offset , offset + len , cbuf , 0 ) ; if ( ( _outputTail + len ) > _outputEnd ) { _flushBuffer ( ) ; } _writeStringSegment ( cbuf , 0 , len ) ; offset += len ; left -= len ; } }
method called when string to write is long enough not to fit completely in temporary copy buffer . if so , we will actually copy it in small enough chunks so it can be directly fed to single - segment writes ( instead of maximum slices that would fit in copy buffer )
