_writeLongString(text); return; _writeLongString(_charBuffer, 0, len); return;
_writeLongString(text); return; _writeLongString(_charBuffer, 0, len); return;
@Override public void writeString(String text) throws IOException, JsonGenerationException { _verifyValueWrite("write text value"); if (text == null) { _writeNull(); return; } // First: can we make a local copy of chars that make up text? final int len = text.length(); if (len > _charBufferLength) { // nope: off-line handling _writeLongString(text); return; } // yes: good. text.getChars(0, len, _charBuffer, 0); // Output: if we can't guarantee it fits in output buffer, off-line as well: if (len > _outputMaxContiguous) { _writeLongString(_charBuffer, 0, len); return; } if ((_outputTail + len + 2) > _outputEnd) { _flushBuffer(); } _outputBuffer[_outputTail++] = BYTE_QUOTE; _writeStringSegment(_charBuffer, 0, len); // we checked space already above _outputBuffer[_outputTail++] = BYTE_QUOTE; }
@Override public void writeString(String text) throws IOException, JsonGenerationException { _verifyValueWrite("write text value"); if (text == null) { _writeNull(); return; } // First: can we make a local copy of chars that make up text? final int len = text.length(); if (len > _charBufferLength) { // nope: off-line handling _writeLongString(text); return; } // yes: good. text.getChars(0, len, _charBuffer, 0); // Output: if we can't guarantee it fits in output buffer, off-line as well: if (len > _outputMaxContiguous) { _writeLongString(_charBuffer, 0, len); return; } if ((_outputTail + len + 2) > _outputEnd) { _flushBuffer(); } _outputBuffer[_outputTail++] = BYTE_QUOTE; _writeStringSegment(_charBuffer, 0, len); // we checked space already above _outputBuffer[_outputTail++] = BYTE_QUOTE; }