final class JSONWriterJSONB extends JSONWriter
JSONWriter.Context, JSONWriter.Feature, JSONWriter.Path| Modifier and Type | Field and Description |
|---|---|
(package private) byte[] |
bytes |
private JSONFactory.CacheItem |
cacheItem |
(package private) static byte[] |
OFFSET_8_ZONE_ID_NAME_BYTES |
private long |
rootTypeNameHash |
(package private) static byte[] |
SHANGHAI_ZONE_ID_NAME_BYTES |
(package private) int |
symbolIndex |
(package private) TLongIntHashMap |
symbols |
attachment, charset, context, jsonb, lastReference, level, MAKS_ERROR_ON_NONE_SERIALIZABLE, MASK_BEAN_TO_ARRAY, MASK_BROWSER_COMPATIBLE, MASK_BROWSER_SECURE, MASK_ESCAPE_NONE_ASCII, MASK_FIELD_BASED, MASK_IGNORE_ERROR_GETTER, MASK_IGNORE_NON_FIELD_GETTER, MASK_IGNORE_NONE_SERIALIZABLE, MASK_NOT_WRITE_DEFAULT_VALUE, MASK_NOT_WRITE_EMPTY_ARRAY, MASK_NOT_WRITE_HASHMAP_ARRAY_LIST_CLASS_NAME, MASK_NOT_WRITE_NUMBER_CLASS_NAME, MASK_NOT_WRITE_ROOT_CLASSNAME, MASK_NULL_AS_DEFAULT_VALUE, MASK_PRETTY_FORMAT, MASK_REFERENCE_DETECTION, MASK_UNQUOTE_FIELD_NAME, MASK_USE_SINGLE_QUOTES, MASK_WRITE_BIG_DECIMAL_AS_PLAIN, MASK_WRITE_BOOLEAN_AS_NUMBER, MASK_WRITE_CLASS_NAME, MASK_WRITE_ENUM_USING_ORDINAL, MASK_WRITE_ENUM_USING_TO_STRING, MASK_WRITE_ENUMS_USING_NAME, MASK_WRITE_FLOAT_SPECIAL_AS_STRING, MASK_WRITE_LONG_AS_STRING, MASK_WRITE_MAP_NULL_VALUE, MASK_WRITE_NON_STRING_KEY_AS_STRING, MASK_WRITE_NON_STRING_VALUE_AS_STRING, MASK_WRITE_NULL_BOOLEAN_AS_FALSE, MASK_WRITE_NULL_LIST_AS_EMPTY, MASK_WRITE_NULL_NUMBER_AS_ZERO, MASK_WRITE_NULL_STRING_AS_EMPTY, MASK_WRITE_PAIR_AS_JAVA_BEAN, maxArraySize, NONE_DIRECT_FEATURES, off, path, pretty, PRETTY_2_SPACE, PRETTY_4_SPACE, PRETTY_NON, PRETTY_TAB, quote, refs, rootObject, startObject, symbolTable, useSingleQuote, utf16, utf8, WRITE_ARRAY_NULL_MASK| Constructor and Description |
|---|
JSONWriterJSONB(JSONWriter.Context ctx,
SymbolTable symbolTable) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this JSONWriter and releases any resources associated with it.
|
void |
endArray()
Ends the current JSON array.
|
void |
endObject()
Ends writing a JSON object.
|
java.lang.Object |
ensureCapacity(int minCapacity)
Ensures that the internal buffer has at least the specified minimum capacity.
|
int |
flushTo(java.io.OutputStream to)
Flushes the content of this JSONWriter to the specified OutputStream.
|
int |
flushTo(java.io.OutputStream out,
java.nio.charset.Charset charset)
Flushes the content of this JSONWriter to the specified OutputStream using the specified charset.
|
byte[] |
getBytes()
Gets the content of the output buffer as a byte array.
|
byte[] |
getBytes(java.nio.charset.Charset charset)
Gets the content of the output buffer as a byte array using the specified charset.
|
private byte[] |
grow(int minCapacity) |
private void |
grow0(int minCapacity) |
private byte[] |
grow1(int off) |
void |
println()
Writes a line break followed by indentation whitespace.
|
int |
size()
Gets the current size of the output buffer.
|
(package private) static int |
sizeOfInt(int i) |
void |
startArray()
Starts writing a JSON array.
|
void |
startArray(int size)
Starts writing a JSON array with a specified initial capacity.
|
void |
startArray(java.lang.Object array,
int size)
Starts writing a JSON array with the specified array and size.
|
void |
startArray0()
Starts writing a JSON array with zero expected elements.
|
void |
startArray1()
Starts writing a JSON array with one expected element.
|
void |
startArray10()
Starts writing a JSON array with ten expected elements.
|
void |
startArray11()
Starts writing a JSON array with eleven expected elements.
|
void |
startArray12()
Starts writing a JSON array with twelve expected elements.
|
void |
startArray13()
Starts writing a JSON array with thirteen expected elements.
|
void |
startArray14()
Starts writing a JSON array with fourteen expected elements.
|
void |
startArray15()
Starts writing a JSON array with fifteen expected elements.
|
void |
startArray2()
Starts writing a JSON array with two expected elements.
|
void |
startArray3()
Starts writing a JSON array with three expected elements.
|
void |
startArray4()
Starts writing a JSON array with four expected elements.
|
void |
startArray5()
Starts writing a JSON array with five expected elements.
|
void |
startArray6()
Starts writing a JSON array with six expected elements.
|
void |
startArray7()
Starts writing a JSON array with seven expected elements.
|
void |
startArray8()
Starts writing a JSON array with eight expected elements.
|
void |
startArray9()
Starts writing a JSON array with nine expected elements.
|
void |
startObject()
Starts writing a JSON object.
|
java.lang.String |
toString() |
(package private) boolean |
tryWriteStringUTF16(byte[] value) |
void |
write(java.util.List array)
Writes a list as a JSON array.
|
void |
write(java.util.Map map)
Writes a Map as a JSON object.
|
protected void |
write0(char ch)
Writes a character to the output.
|
void |
writeAny(java.lang.Object value)
Writes any object using the appropriate writer based on its runtime type.
|
void |
writeArrayNull()
Writes a null array value using the current context features.
|
void |
writeArrayNull(long features)
Writes a null array value using the specified features.
|
void |
writeBase64(byte[] bytes)
Writes a byte array as Base64-encoded string.
|
void |
writeBigInt(java.math.BigInteger value,
long features)
Writes a BigInteger value using the specified features.
|
void |
writeBinary(byte[] binary)
Writes a byte array as either Base64-encoded string or as an array of integers,
depending on the WriteByteArrayAsBase64 feature.
|
void |
writeBool(boolean value)
Writes a boolean value.
|
void |
writeBool(boolean[] values)
Writes a boolean array as boolean values.
|
void |
writeChar(char ch)
Writes a character without any escaping or formatting.
|
void |
writeColon()
Writes a colon separator.
|
void |
writeComma()
Writes a comma separator.
|
void |
writeDateTime14(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
Writes a date-time value in 14-character format (yyyyMMddHHmmss).
|
void |
writeDateTime19(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
Writes a date-time value in 19-character format (yyyy-MM-dd HH:mm:ss).
|
void |
writeDateTimeISO8601(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millis,
int offsetSeconds,
boolean timeZone)
Writes a date-time value in ISO8601 format.
|
void |
writeDateYYYMMDD10(int year,
int month,
int dayOfMonth)
Writes a date in 10-character format (yyyy-MM-dd).
|
void |
writeDateYYYMMDD8(int year,
int month,
int dayOfMonth)
Writes a date in 8-character format (yyyyMMdd).
|
void |
writeDecimal(java.math.BigDecimal value,
long features,
java.text.DecimalFormat format)
Writes a BigDecimal value using the specified features and decimal format.
|
void |
writeDouble(double value)
Writes a double value.
|
void |
writeDouble(double[] values)
Writes a double array as floating-point numbers.
|
void |
writeEnum(java.lang.Enum e)
Writes an Enum value.
|
void |
writeFloat(float value)
Writes a float value.
|
void |
writeFloat(float[] values) |
void |
writeHex(byte[] bytes)
Writes a byte array as hexadecimal string.
|
void |
writeInstant(java.time.Instant instant)
Writes an Instant value as an ISO-8601 formatted string.
|
void |
writeInt16(short val)
Writes a short value as an integer.
|
void |
writeInt16(short[] values)
Writes a short array as integers.
|
void |
writeInt32(int val)
Writes an int value.
|
void |
writeInt32(int[] values)
Writes an int array as integers.
|
void |
writeInt32(java.lang.Integer i)
Writes an Integer object.
|
void |
writeInt64(long val)
Writes a long value.
|
void |
writeInt64(java.lang.Long i)
Writes a Long object.
|
void |
writeInt64(long[] value)
Writes a long array as integers.
|
void |
writeInt8(byte val)
Writes a byte value as an integer.
|
void |
writeInt8(byte[] values)
Writes a byte array as integers.
|
void |
writeListInt32(java.util.List<java.lang.Integer> values)
Writes a list of Integer values as integers.
|
void |
writeListInt64(java.util.List<java.lang.Long> values)
Writes a list of Long values as integers.
|
void |
writeLocalDate(java.time.LocalDate date)
Writes a LocalDate value.
|
void |
writeLocalDateTime(java.time.LocalDateTime dateTime)
Writes a LocalDateTime value.
|
void |
writeLocalTime(java.time.LocalTime time)
Writes a LocalTime value.
|
void |
writeMillis(long millis)
Writes a timestamp value as a long integer.
|
void |
writeName(java.lang.String name) |
void |
writeName10Raw(long name0,
long name1)
Writes a 10-character field name as raw bytes without any escaping or formatting.
|
void |
writeName11Raw(long name0,
long name1)
Writes an 11-character field name as raw bytes without any escaping or formatting.
|
void |
writeName12Raw(long name0,
long name1)
Writes a 12-character field name as raw bytes without any escaping or formatting.
|
void |
writeName13Raw(long name0,
long name1)
Writes a 13-character field name as raw bytes without any escaping or formatting.
|
void |
writeName14Raw(long name0,
long name1)
Writes a 14-character field name as raw bytes without any escaping or formatting.
|
void |
writeName15Raw(long name0,
long name1)
Writes a 15-character field name as raw bytes without any escaping or formatting.
|
void |
writeName16Raw(long name0,
long name1)
Writes a 16-character field name as raw bytes without any escaping or formatting.
|
void |
writeName2Raw(long name)
Writes a 2-character field name as raw bytes without any escaping or formatting.
|
void |
writeName3Raw(long name)
Writes a 3-character field name as raw bytes without any escaping or formatting.
|
void |
writeName4Raw(long name)
Writes a 4-character field name as raw bytes without any escaping or formatting.
|
void |
writeName5Raw(long name)
Writes a 5-character field name as raw bytes without any escaping or formatting.
|
void |
writeName6Raw(long name)
Writes a 6-character field name as raw bytes without any escaping or formatting.
|
void |
writeName7Raw(long name)
Writes a 7-character field name as raw bytes without any escaping or formatting.
|
void |
writeName8Raw(long name)
Writes an 8-character field name as raw bytes without any escaping or formatting.
|
void |
writeName9Raw(long name0,
int name1)
Writes a 9-character field name as raw bytes without any escaping or formatting.
|
void |
writeNameRaw(byte[] bytes)
Writes raw bytes representing a field name without any escaping or formatting.
|
void |
writeNameRaw(byte[] name,
long nameHash)
Writes raw bytes representing a field name without any escaping or formatting.
|
void |
writeNameRaw(char[] chars)
Writes raw characters representing a field name without any escaping or formatting.
|
void |
writeNameRaw(char[] bytes,
int offset,
int len)
Writes raw characters representing a field name without any escaping or formatting.
|
void |
writeNull()
Writes a null value.
|
void |
writeOffsetDateTime(java.time.OffsetDateTime dateTime)
Writes an OffsetDateTime value.
|
void |
writeOffsetTime(java.time.OffsetTime offsetTime)
Writes an OffsetTime value.
|
void |
writeRaw(byte b)
Writes a raw byte without any escaping or formatting.
|
void |
writeRaw(byte[] raw)
Writes raw bytes without any escaping or formatting.
|
void |
writeRaw(char ch)
Writes a raw character without any escaping or formatting.
|
void |
writeRaw(java.lang.String str)
Writes a raw string without any escaping or formatting.
|
void |
writeReference(java.lang.String path)
Writes a reference to a previously serialized object.
|
void |
writeString(boolean value)
Writes a boolean value as a string.
|
void |
writeString(boolean[] value)
Writes a boolean array as strings.
|
void |
writeString(byte value)
Writes a byte value as a string.
|
void |
writeString(byte[] value)
Writes a byte array as strings.
|
void |
writeString(char[] chars)
Writes a string from character array.
|
void |
writeString(char[] chars,
int charsOff,
int len)
Writes a string from character array with specified offset and length.
|
void |
writeString(char[] chars,
int coff,
int len,
boolean quote)
Writes a string from character array with specified offset and length.
|
void |
writeString(double[] value)
Writes a double array as strings.
|
void |
writeString(float[] value)
Writes a float array as strings.
|
void |
writeString(int value)
Writes an int value as a string.
|
void |
writeString(int[] value)
Writes an int array as strings.
|
void |
writeString(java.util.List<java.lang.String> list)
Writes a list of strings as a JSON array.
|
void |
writeString(long value)
Writes a long value as a string.
|
void |
writeString(long[] value)
Writes a long array as strings.
|
void |
writeString(short value)
Writes a short value as a string.
|
void |
writeString(short[] value)
Writes a short array as strings.
|
void |
writeString(java.lang.String str)
Writes a string value.
|
void |
writeString(java.lang.String[] strings)
Writes an array of strings as a JSON array.
|
private void |
writeString0(char[] chars,
int coff,
int strlen) |
void |
writeStringLatin1(byte[] value)
Writes a string from Latin-1 encoded bytes.
|
private static int |
writeStringLatin1(byte[] bytes,
int off,
char[] chars,
int coff,
int strlen) |
void |
writeStringNull()
Writes a null string value.
|
void |
writeStringUTF16(byte[] value)
Writes a string from UTF-16 encoded bytes.
|
void |
writeSymbol(int symbol)
Writes a symbol as a JSON value.
|
void |
writeSymbol(java.lang.String str)
Writes a symbol string.
|
void |
writeTimeHHMMSS8(int hour,
int minute,
int second)
Writes a time in 8-character format (HH:mm:ss).
|
boolean |
writeTypeName(byte[] typeName,
long hash)
Writes a type name for the current object using byte array and hash.
|
void |
writeTypeName(java.lang.String typeName)
Writes a type name for the current object.
|
private boolean |
writeTypeNameSymbol(int symbol) |
private static int |
writeUTF16(byte[] bytes,
int off,
byte[] value) |
private static int |
writeUTF8(byte[] bytes,
int off,
byte[] value,
int utf8len,
int asciiCount,
int lenByteCnt) |
private static int |
writeUTF8(byte[] bytes,
int off,
char[] chars,
int coff,
int strlen) |
void |
writeUUID(java.util.UUID value)
Writes a UUID value.
|
void |
writeZonedDateTime(java.time.ZonedDateTime dateTime)
Writes a ZonedDateTime value.
|
addManagerReference, checkAndWriteTypeName, config, config, containsReference, decrementIdent, flushTo, getAttachment, getCharset, getContext, getFeatures, getFeatures, getObjectWriter, getObjectWriter, getObjectWriter, getOffset, getPath, getPath, getSymbolTable, hasFilter, hasFilter, hasFilter, illegalYear, incrementIndent, isBeanToArray, isEnabled, isEnabled, isIgnoreErrorGetter, isIgnoreNoneSerializable, isIgnoreNoneSerializable, isRefDetect, isRefDetect, isUseSingleQuotes, isUTF16, isUTF8, isWriteAsString, isWriteAsString, isWriteAsString, isWriteMapTypeInfo, isWriteNulls, isWriteTypeInfo, isWriteTypeInfo, isWriteTypeInfo, isWriteTypeInfo, isWriteTypeInfo, isWriteTypeInfo, level, newCapacity, of, of, of, of, ofJSONB, ofJSONB, ofJSONB, ofJSONB, ofJSONB, ofPretty, ofPretty, ofUTF16, ofUTF8, ofUTF8, ofUTF8, overflowLevel, popPath, popPath0, removeReference, setAttachment, setOffset, setPath, setPath, setPath, setPath0, setPath0, setRootObject, write, writeAs, writeBigInt, writeBooleanNull, writeDecimal, writeDecimal, writeDecimalNull, writeDecimalNull, writeDouble, writeDouble, writeDoubleArray, writeFloat, writeFloat, writeFloat, writeInt32, writeInt32, writeInt64Null, writeInt64Null, writeLocalDateWithFormat, writeName, writeName, writeNameAny, writeNameRaw, writeNameValue, writeNumberNull, writeNumberNull, writeObjectNull, writeRaw, writeRaw, writeRaw, writeReference, writeReference, writeString, writeString, writeStringstatic final byte[] SHANGHAI_ZONE_ID_NAME_BYTES
static final byte[] OFFSET_8_ZONE_ID_NAME_BYTES
private final JSONFactory.CacheItem cacheItem
byte[] bytes
TLongIntHashMap symbols
int symbolIndex
private long rootTypeNameHash
JSONWriterJSONB(JSONWriter.Context ctx, SymbolTable symbolTable)
public void close()
JSONWriterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class JSONWriterpublic void writeAny(java.lang.Object value)
JSONWriterwriteAny in class JSONWritervalue - the object to write, can be nullpublic void startObject()
JSONWriterstartObject in class JSONWriterpublic void endObject()
JSONWriterendObject in class JSONWriterpublic void startArray()
JSONWriterstartArray in class JSONWriterpublic void startArray(java.lang.Object array,
int size)
JSONWriterstartArray in class JSONWriterarray - the array to serializesize - the expected number of elements in the arraypublic void startArray(int size)
JSONWriterstartArray in class JSONWritersize - the expected number of elements in the arraypublic void startArray0()
JSONWriterstartArray0 in class JSONWriterpublic void startArray1()
JSONWriterstartArray1 in class JSONWriterpublic void startArray2()
JSONWriterstartArray2 in class JSONWriterpublic void startArray3()
JSONWriterstartArray3 in class JSONWriterpublic void startArray4()
JSONWriterstartArray4 in class JSONWriterpublic void startArray5()
JSONWriterstartArray5 in class JSONWriterpublic void startArray6()
JSONWriterstartArray6 in class JSONWriterpublic void startArray7()
JSONWriterstartArray7 in class JSONWriterpublic void startArray8()
JSONWriterstartArray8 in class JSONWriterpublic void startArray9()
JSONWriterstartArray9 in class JSONWriterpublic void startArray10()
JSONWriterstartArray10 in class JSONWriterpublic void startArray11()
JSONWriterstartArray11 in class JSONWriterpublic void startArray12()
JSONWriterstartArray12 in class JSONWriterpublic void startArray13()
JSONWriterstartArray13 in class JSONWriterpublic void startArray14()
JSONWriterstartArray14 in class JSONWriterpublic void startArray15()
JSONWriterstartArray15 in class JSONWriterpublic void writeRaw(byte b)
JSONWriterwriteRaw in class JSONWriterb - the byte to writepublic void writeChar(char ch)
JSONWriterwriteChar in class JSONWriterch - the character to writepublic void writeName(java.lang.String name)
writeName in class JSONWriterpublic void writeNull()
JSONWriterwriteNull in class JSONWriterpublic void writeStringNull()
JSONWriterJSONWriter.Feature.NullAsDefaultValue or JSONWriter.Feature.WriteNullStringAsEmpty is enabled, an empty string is writtenwriteStringNull in class JSONWriterpublic void endArray()
JSONWriterendArray in class JSONWriterpublic void writeComma()
JSONWriterwriteComma in class JSONWriterprotected void write0(char ch)
JSONWriterwrite0 in class JSONWriterch - the character to writepublic void writeString(boolean value)
JSONWriterwriteString in class JSONWritervalue - the boolean value to writepublic void writeString(byte value)
JSONWriterwriteString in class JSONWritervalue - the byte value to writepublic void writeString(short value)
JSONWriterwriteString in class JSONWritervalue - the short value to writepublic void writeString(int value)
JSONWriterwriteString in class JSONWritervalue - the int value to writepublic void writeString(long value)
JSONWriterwriteString in class JSONWritervalue - the long value to writepublic void writeString(boolean[] value)
JSONWriterwriteString in class JSONWritervalue - the boolean array to writepublic void writeString(byte[] value)
JSONWriterwriteString in class JSONWritervalue - the byte array to writepublic void writeString(short[] value)
JSONWriterwriteString in class JSONWritervalue - the short array to writepublic void writeString(int[] value)
JSONWriterwriteString in class JSONWritervalue - the int array to writepublic void writeString(long[] value)
JSONWriterwriteString in class JSONWritervalue - the long array to writepublic void writeString(float[] value)
JSONWriterwriteString in class JSONWritervalue - the float array to writepublic void writeString(double[] value)
JSONWriterwriteString in class JSONWritervalue - the double array to writepublic void writeString(char[] chars,
int coff,
int len,
boolean quote)
JSONWriterwriteString in class JSONWriterchars - the character array to writecoff - the offset in the arraylen - the number of characters to writequote - whether to quote the stringpublic void writeStringLatin1(byte[] value)
JSONWriterwriteStringLatin1 in class JSONWritervalue - the Latin-1 encoded bytes to writepublic void writeString(char[] chars)
JSONWriterwriteString in class JSONWriterchars - the character array to writepublic void writeString(char[] chars,
int charsOff,
int len)
JSONWriterwriteString in class JSONWriterchars - the character array to writecharsOff - the offset in the arraylen - the number of characters to writeprivate void writeString0(char[] chars,
int coff,
int strlen)
private static int writeStringLatin1(byte[] bytes,
int off,
char[] chars,
int coff,
int strlen)
private static int writeUTF8(byte[] bytes,
int off,
char[] chars,
int coff,
int strlen)
public void writeString(java.lang.String[] strings)
JSONWriterwriteString in class JSONWriterstrings - the array of strings to write, can be nullpublic void writeSymbol(java.lang.String str)
JSONWriterwriteSymbol in class JSONWriterstr - the symbol string to writepublic void writeTypeName(java.lang.String typeName)
JSONWriterwriteTypeName in class JSONWritertypeName - the type name to writepublic boolean writeTypeName(byte[] typeName,
long hash)
JSONWriterwriteTypeName in class JSONWritertypeName - the type name as byte arrayhash - the hash of the type nameprivate boolean writeTypeNameSymbol(int symbol)
static int sizeOfInt(int i)
public void writeString(java.util.List<java.lang.String> list)
JSONWriterwriteString in class JSONWriterlist - the list of strings to write, can be nullpublic void writeString(java.lang.String str)
JSONWriterwriteString in class JSONWriterstr - the string to write, can be nullpublic void writeStringUTF16(byte[] value)
JSONWriterwriteStringUTF16 in class JSONWritervalue - the UTF-16 encoded bytes to writeboolean tryWriteStringUTF16(byte[] value)
private static int writeUTF8(byte[] bytes,
int off,
byte[] value,
int utf8len,
int asciiCount,
int lenByteCnt)
private static int writeUTF16(byte[] bytes,
int off,
byte[] value)
public final java.lang.Object ensureCapacity(int minCapacity)
JSONWriterensureCapacity in class JSONWriterminCapacity - the minimum capacity requiredprivate byte[] grow1(int off)
private byte[] grow(int minCapacity)
private void grow0(int minCapacity)
public void writeMillis(long millis)
JSONWriterwriteMillis in class JSONWritermillis - the timestamp value to write as millisecondspublic void writeInt64(java.lang.Long i)
JSONWriterwriteInt64 in class JSONWriteri - the Long object to writepublic void writeInt64(long val)
JSONWriterwriteInt64 in class JSONWriterval - the long value to writepublic void writeInt64(long[] value)
JSONWriterwriteInt64 in class JSONWritervalue - the long array to writepublic void writeListInt64(java.util.List<java.lang.Long> values)
JSONWriterwriteListInt64 in class JSONWritervalues - the list of Long values to writepublic void writeFloat(float value)
JSONWriterwriteFloat in class JSONWritervalue - the float value to writepublic void writeFloat(float[] values)
writeFloat in class JSONWriterpublic void writeDouble(double value)
JSONWriterwriteDouble in class JSONWritervalue - the double value to writepublic void writeDouble(double[] values)
JSONWriterwriteDouble in class JSONWritervalues - the double array to writepublic void writeInt16(short[] values)
JSONWriterwriteInt16 in class JSONWritervalues - the short array to write, can be nullpublic void writeInt32(int[] values)
JSONWriterwriteInt32 in class JSONWritervalues - the int array to writepublic void writeInt8(byte[] values)
JSONWriterwriteInt8 in class JSONWritervalues - the byte array to writepublic void writeInt8(byte val)
JSONWriterwriteInt8 in class JSONWriterval - the byte value to writepublic void writeInt16(short val)
JSONWriterwriteInt16 in class JSONWriterval - the short value to writepublic void writeEnum(java.lang.Enum e)
JSONWriterJSONWriter.Feature.WriteEnumUsingToString is enabled, the enum is written using its toString() methodJSONWriter.Feature.WriteEnumsUsingName is enabled, the enum is written using its name()writeEnum in class JSONWritere - the Enum value to write, can be nullpublic void writeInt32(java.lang.Integer i)
JSONWriterwriteInt32 in class JSONWriteri - the Integer object to writepublic void writeInt32(int val)
JSONWriterwriteInt32 in class JSONWriterval - the int value to writepublic void writeListInt32(java.util.List<java.lang.Integer> values)
JSONWriterwriteListInt32 in class JSONWritervalues - the list of Integer values to writepublic void writeArrayNull()
JSONWriterJSONWriter.Feature.NullAsDefaultValue or JSONWriter.Feature.WriteNullListAsEmpty is enabled, an empty array is writtenwriteArrayNull in class JSONWriterpublic void writeArrayNull(long features)
JSONWriterJSONWriter.Feature.NullAsDefaultValue or JSONWriter.Feature.WriteNullListAsEmpty is enabled, an empty array is writtenwriteArrayNull in class JSONWriterfeatures - the features to use for serializationpublic void writeRaw(java.lang.String str)
JSONWriterwriteRaw in class JSONWriterstr - the string to writepublic void writeRaw(byte[] raw)
JSONWriterwriteRaw in class JSONWriterraw - the bytes to writepublic void writeSymbol(int symbol)
JSONWriterwriteSymbol in class JSONWritersymbol - the symbol to writepublic void writeNameRaw(byte[] name,
long nameHash)
JSONWriterwriteNameRaw in class JSONWritername - the bytes representing the field namenameHash - the hash of the field namepublic void writeLocalDate(java.time.LocalDate date)
JSONWriterwriteLocalDate in class JSONWriterdate - the LocalDate to writepublic void writeLocalTime(java.time.LocalTime time)
JSONWriterwriteLocalTime in class JSONWritertime - the LocalTime to writepublic void writeLocalDateTime(java.time.LocalDateTime dateTime)
JSONWriterwriteLocalDateTime in class JSONWriterdateTime - the LocalDateTime to writepublic void writeZonedDateTime(java.time.ZonedDateTime dateTime)
JSONWriterwriteZonedDateTime in class JSONWriterdateTime - the ZonedDateTime to writepublic void writeOffsetDateTime(java.time.OffsetDateTime dateTime)
JSONWriterwriteOffsetDateTime in class JSONWriterdateTime - the OffsetDateTime to writepublic void writeOffsetTime(java.time.OffsetTime offsetTime)
JSONWriterwriteOffsetTime in class JSONWriteroffsetTime - the OffsetTime to writepublic void writeInstant(java.time.Instant instant)
JSONWriterwriteInstant in class JSONWriterinstant - the Instant to write, can be nullpublic void writeUUID(java.util.UUID value)
JSONWriterwriteUUID in class JSONWritervalue - the UUID to write, can be nullpublic void writeBigInt(java.math.BigInteger value,
long features)
JSONWriterwriteBigInt in class JSONWritervalue - the BigInteger value to write, can be nullfeatures - the features to use for serializationpublic void writeBinary(byte[] binary)
JSONWriterwriteBinary in class JSONWriterbinary - the byte array to writepublic void writeDecimal(java.math.BigDecimal value,
long features,
java.text.DecimalFormat format)
JSONWriterwriteDecimal in class JSONWritervalue - the BigDecimal value to write, can be nullfeatures - the features to use for serializationformat - the decimal format to use, or null to use default formattingpublic void writeBool(boolean value)
JSONWriterwriteBool in class JSONWritervalue - the boolean value to writepublic void writeBool(boolean[] values)
JSONWriterwriteBool in class JSONWritervalues - the boolean array to write, can be nullpublic void writeReference(java.lang.String path)
JSONWriterwriteReference in class JSONWriterpath - the JSON Pointer path to the referenced objectpublic void writeDateTime14(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
JSONWriterwriteDateTime14 in class JSONWriteryear - the yearmonth - the month (1-12)dayOfMonth - the day of month (1-31)hour - the hour (0-23)minute - the minute (0-59)second - the second (0-59)public void writeDateTime19(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
JSONWriterwriteDateTime19 in class JSONWriteryear - the yearmonth - the month (1-12)dayOfMonth - the day of month (1-31)hour - the hour (0-23)minute - the minute (0-59)second - the second (0-59)public void writeDateTimeISO8601(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millis,
int offsetSeconds,
boolean timeZone)
JSONWriterwriteDateTimeISO8601 in class JSONWriteryear - the yearmonth - the month (1-12)dayOfMonth - the day of month (1-31)hour - the hour (0-23)minute - the minute (0-59)second - the second (0-59)millis - the millisecond (0-999)offsetSeconds - the timezone offset in secondstimeZone - whether to include timezone informationpublic void writeDateYYYMMDD8(int year,
int month,
int dayOfMonth)
JSONWriterwriteDateYYYMMDD8 in class JSONWriteryear - the yearmonth - the month (1-12)dayOfMonth - the day of month (1-31)public void writeDateYYYMMDD10(int year,
int month,
int dayOfMonth)
JSONWriterwriteDateYYYMMDD10 in class JSONWriteryear - the yearmonth - the month (1-12)dayOfMonth - the day of month (1-31)public void writeTimeHHMMSS8(int hour,
int minute,
int second)
JSONWriterwriteTimeHHMMSS8 in class JSONWriterhour - the hour (0-23)minute - the minute (0-59)second - the second (0-59)public void writeBase64(byte[] bytes)
JSONWriterwriteBase64 in class JSONWriterbytes - the byte array to encode and writepublic void writeHex(byte[] bytes)
JSONWriterwriteHex in class JSONWriterbytes - the byte array to encode and writepublic void writeRaw(char ch)
JSONWriterwriteRaw in class JSONWriterch - the character to writepublic void writeNameRaw(byte[] bytes)
JSONWriterwriteNameRaw in class JSONWriterbytes - the bytes to writepublic void writeName2Raw(long name)
JSONWriterwriteName2Raw in class JSONWritername - the 2-character field name as a long valuepublic void writeName3Raw(long name)
JSONWriterwriteName3Raw in class JSONWritername - the 3-character field name as a long valuepublic void writeName4Raw(long name)
JSONWriterwriteName4Raw in class JSONWritername - the 4-character field name as a long valuepublic void writeName5Raw(long name)
JSONWriterwriteName5Raw in class JSONWritername - the 5-character field name as a long valuepublic void writeName6Raw(long name)
JSONWriterwriteName6Raw in class JSONWritername - the 6-character field name as a long valuepublic void writeName7Raw(long name)
JSONWriterwriteName7Raw in class JSONWritername - the 7-character field name as a long valuepublic void writeName8Raw(long name)
JSONWriterwriteName8Raw in class JSONWritername - the 8-character field name as a long valuepublic void writeName9Raw(long name0,
int name1)
JSONWriterwriteName9Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the 9th character of the field name as an integer valuepublic void writeName10Raw(long name0,
long name1)
JSONWriterwriteName10Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 2 characters of the field name as a long valuepublic void writeName11Raw(long name0,
long name1)
JSONWriterwriteName11Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 3 characters of the field name as a long valuepublic void writeName12Raw(long name0,
long name1)
JSONWriterwriteName12Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 4 characters of the field name as a long valuepublic void writeName13Raw(long name0,
long name1)
JSONWriterwriteName13Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 5 characters of the field name as a long valuepublic void writeName14Raw(long name0,
long name1)
JSONWriterwriteName14Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 6 characters of the field name as a long valuepublic void writeName15Raw(long name0,
long name1)
JSONWriterwriteName15Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 7 characters of the field name as a long valuepublic void writeName16Raw(long name0,
long name1)
JSONWriterwriteName16Raw in class JSONWritername0 - the first 8 characters of the field name as a long valuename1 - the last 8 characters of the field name as a long valuepublic void writeNameRaw(char[] chars)
JSONWriterwriteNameRaw in class JSONWriterchars - the character array to writepublic void writeNameRaw(char[] bytes,
int offset,
int len)
JSONWriterwriteNameRaw in class JSONWriterbytes - the character array to writeoffset - the offset in the character arraylen - the number of characters to writepublic void writeColon()
JSONWriterwriteColon in class JSONWriterpublic void write(java.util.List array)
JSONWriterwrite in class JSONWriterarray - the list to writepublic void write(java.util.Map map)
JSONWriterwrite in class JSONWritermap - the Map to write, can be nullpublic byte[] getBytes()
JSONWritergetBytes in class JSONWriterpublic int size()
JSONWritersize in class JSONWriterpublic byte[] getBytes(java.nio.charset.Charset charset)
JSONWritergetBytes in class JSONWritercharset - the charset to use for encodingpublic int flushTo(java.io.OutputStream to)
throws java.io.IOException
JSONWriterflushTo in class JSONWriterto - the OutputStream to flush content tojava.io.IOException - if an I/O error occurs while writing to the OutputStreampublic int flushTo(java.io.OutputStream out,
java.nio.charset.Charset charset)
JSONWriterflushTo in class JSONWriterout - the OutputStream to flush content tocharset - the charset to use for encodingpublic java.lang.String toString()
toString in class java.lang.Objectpublic void println()
JSONWriterprintln in class JSONWriter