@Override public void writeString(char[] text, int offset, int len) throws IOException { _verifyValueWrite("write String value"); if (len == 0) { _writeByte(BYTE_EMPTY_STRING); return; } _writeString(text, offset, len); }
@Override public void writeString(char[] text, int offset, int len) throws IOException { _verifyValueWrite("write String value"); if (len == 0) { _writeByte(BYTE_EMPTY_STRING); return; } _writeString(text, offset, len); }
@Override public void writeString(String text) throws IOException { if (text == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(text); }
@Override public final void writeFieldName(String name) throws IOException { if (_writeContext.writeFieldName(name) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(name); }
@Override public final void writeFieldName(String name) throws IOException { if (_writeContext.writeFieldName(name) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(name); }
@Override public void writeString(String text) throws IOException,JsonGenerationException { if (text == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(text); }
@Override public final void writeFieldName(String name) throws IOException { if (_writeContext.writeFieldName(name) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(name); }
@Override public void writeString(String text) throws IOException,JsonGenerationException { if (text == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(text); }
@Override public void writeString(char[] text, int offset, int len) throws IOException { _verifyValueWrite("write String value"); if (len == 0) { _writeByte(BYTE_EMPTY_STRING); return; } _writeString(text, offset, len); }
@Override public final void writeStringField(String fieldName, String value) throws IOException { if (_writeContext.writeFieldName(fieldName) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(fieldName); // inlined from 'writeString()' if (value == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(value); }
@Override public final void writeStringField(String fieldName, String value) throws IOException { if (_writeContext.writeFieldName(fieldName) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(fieldName); // inlined from 'writeString()' if (value == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(value); }
@Override public final void writeStringField(String fieldName, String value) throws IOException { if (_writeContext.writeFieldName(fieldName) == JsonWriteContext.STATUS_EXPECT_VALUE) { _reportError("Can not write a field name, expecting a value"); } _writeString(fieldName); // inlined from 'writeString()' if (value == null) { writeNull(); return; } _verifyValueWrite("write String value"); _writeString(value); }
_writeString(cbuf, 0, len);
_writeString(cbuf, 0, len);
protected final void _writeChunkedString(char[] text, int offset, int len) throws IOException { // need to use a marker first _writeByte(BYTE_STRING_INDEFINITE); while (len > MAX_LONG_STRING_CHARS) { _ensureSpace(MAX_LONG_STRING_BYTES); // marker and single-byte length? int ix = _outputTail; int actual = _encode(_outputTail+3, text, offset, offset+MAX_LONG_STRING_CHARS); final byte[] buf = _outputBuffer; buf[ix++] = BYTE_STRING_2BYTE_LEN; buf[ix++] = (byte) (actual >> 8); buf[ix++] = (byte) actual; _outputTail = ix+actual; offset += MAX_LONG_STRING_CHARS; len -= MAX_LONG_STRING_CHARS; } // and for the last chunk, just use recursion if (len > 0) { _writeString(text, offset, len); } // plus end marker _writeByte(BYTE_BREAK); }
protected final void _writeChunkedString(char[] text, int offset, int len) throws IOException { // need to use a marker first _writeByte(BYTE_STRING_INDEFINITE); while (len > MAX_LONG_STRING_CHARS) { _ensureSpace(MAX_LONG_STRING_BYTES); // marker and single-byte length? int ix = _outputTail; int actual = _encode(_outputTail+3, text, offset, offset+MAX_LONG_STRING_CHARS); final byte[] buf = _outputBuffer; buf[ix++] = BYTE_STRING_2BYTE_LEN; buf[ix++] = (byte) (actual >> 8); buf[ix++] = (byte) actual; _outputTail = ix+actual; offset += MAX_LONG_STRING_CHARS; len -= MAX_LONG_STRING_CHARS; } // and for the last chunk, just use recursion if (len > 0) { _writeString(text, offset, len); } // plus end marker _writeByte(BYTE_BREAK); }
_writeString(text, offset, len);