com.github.plokhotnyuk.jsoniter_scala.core
Members list
Type members
Classlikes
A JsonCodec[A]
instance is a universal codec for JSON values and keys.
A JsonCodec[A]
instance is a universal codec for JSON values and keys.
BEWARE: Minimize usage of JsonCodec[A]
due to possible creation of the scalability limit on the JDK level,
for more info see:
Attributes
- Graph
- Supertypes
A JsonKeyCodec[A]
instance has the ability to decode and encode JSON keys to/from values of type A
,
potentially failing with an error if the JSON input is not a key or does not encode a value of the given type or
A
cannot be encoded properly according to RFC-8259 requirements.
A JsonKeyCodec[A]
instance has the ability to decode and encode JSON keys to/from values of type A
,
potentially failing with an error if the JSON input is not a key or does not encode a value of the given type or
A
cannot be encoded properly according to RFC-8259 requirements.
Attributes
- Graph
- Supertypes
- trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
- trait JsonCodec[A]
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- JsonReader.type
Attributes
- Graph
- Supertypes
- class RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass Any
A JsonValueCodec[A]
instance has the ability to decode and encode JSON values to/from values of type A
,
potentially failing with an error if the JSON content does not encode a value of the given type or A
cannot be
encoded properly according to RFC-8259 requirements.
A JsonValueCodec[A]
instance has the ability to decode and encode JSON values to/from values of type A
,
potentially failing with an error if the JSON content does not encode a value of the given type or A
cannot be
encoded properly according to RFC-8259 requirements.
Attributes
- Graph
- Supertypes
- trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
- trait JsonCodec[A]
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- JsonWriter.type
Attributes
- Graph
- Supertypes
- class RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass Any
Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonReader that contains flags for tuning of
parsing exceptions and preferred sizes for internal buffers that are created on the reader instantiation and reused
in runtime for parsing of messages.
All configuration params already initialized by recommended default values, but in some cases they should be altered
for performance reasons:
Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonReader that contains flags for tuning of
parsing exceptions and preferred sizes for internal buffers that are created on the reader instantiation and reused
in runtime for parsing of messages.
All configuration params already initialized by recommended default values, but in some cases they should be altered
for performance reasons:
-
turn off stack traces for parsing exceptions to greatly reduce impact on performance for cases when exceptions can be not exceptional (e.g. under DoS attacks over open to the world systems), see more details here: https://shipilev.net/blog/2014/exceptional-performance/
-
turn off appending of hex dump to minimize length of exception message
-
increase preferred size of an internal byte buffer for parsing from java.io.InputStream or java.nio.DirectByteBuffer to reduce allocation rate of grown and then reduced buffers during parsing of large (>16Kb) numbers (including stringified), raw values, or ADT instances with the discriminator field doesn't appear in the beginning of the JSON object
-
increase preferred size of an internal char buffer to reduce allocation rate of grown and then reduced buffers when large (>4Kb) string instances need to be parsed including those one which use Base16 or Base64 encodings
Attributes
- appendHexDumpToParseException
a flag that allows to turn off hex dumping of affected by error part of an internal byte buffer
- checkForEndOfInput
a flag to check and raise an error if some non whitespace bytes will be detected after successful parsing of the value
- hexDumpSize
a size of the hex dump in 16-byte lines before and after the 16-byte line where an error occurs
- maxBufSize
a max size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.DirectByteBuffer
- maxCharBufSize
a max size (in chars) of an internal char buffer for parsing of string values including those one which use Base16 or Base64 encodings
- preferredBufSize
a preferred size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.DirectByteBuffer
- preferredCharBufSize
a preferred size (in chars) of an internal char buffer for parsing of string values
- throwReaderExceptionWithStackTrace
a flag that allows to turn on a stack traces for debugging purposes in development
- Companion:
- object
- Graph
- Supertypes
- trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
- object ReaderConfig.type
Attributes
- Companion:
- class
- Graph
- Supertypes
- Self type
- ReaderConfig.type
Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonWriter that contains params for formatting of
output JSON and for tuning of preferred size for internal byte buffer that is created on the writer instantiation
and reused in runtime for serialization of messages using java.io.OutputStream or java.nio.DirectByteBuffer.
All configuration params already initialized to default values, but in some cases they should be altered:
Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonWriter that contains params for formatting of
output JSON and for tuning of preferred size for internal byte buffer that is created on the writer instantiation
and reused in runtime for serialization of messages using java.io.OutputStream or java.nio.DirectByteBuffer.
All configuration params already initialized to default values, but in some cases they should be altered:
-
turn on pretty printing by specifying of indention step that is greater than 0
-
turn on escaping of Unicode characters to serialize with only ASCII characters
-
increase preferred size of an internal byte buffer to reduce allocation rate of grown and then reduced buffers when writing to java.io.OutputStream or java.nio.DirectByteBuffer lot of large (>16Kb) scala.math.BigDecimal, scala.math.BigInt or other non escaped ASCII strings written using
JsonWriter.writeNonEscapedAsciiKey
orJsonWriter.writeNonEscapedAsciiVal
Attributes
- escapeUnicode
a flag to turn on hexadecimal escaping of all non-ASCII chars
- indentionStep
a size of indention for pretty-printed formatting or 0 for compact output
- preferredBufSize
a preferred size (in bytes) of an internal byte buffer when writing to java.io.OutputStream or java.nio.DirectByteBuffer
- throwWriterExceptionWithStackTrace
a flag that allows to turn on a stack traces for debugging purposes in development
- Companion:
- object
- Graph
- Supertypes
- trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
- object WriterConfig.type
Attributes
- Companion:
- class
- Graph
- Supertypes
- Self type
- WriterConfig.type
Value members
Concrete methods
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Attributes
- A
type of the value to parse
- buf
the byte array to parse from
- codec
a codec for the given
A
type- config
a parsing configuration
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also in case if end of input is detected while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,buf
orconfig
is null
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
While it is less efficient than parsing from a byte array using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- buf
the byte array to parse from
- codec
a codec for the given
A
type- config
a parsing configuration
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also in case if end of input is detected while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,buf
orconfig
is null
Deserialize JSON content encoded in UTF-8 from a byte buffer into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte buffer into a value of given A
type.
Parsing will start from the current position and will continue until the limit of the provided byte buffer or the value will be parsed before reaching of the limit. In any case the buffer position will be set to the next position after the last read byte.
Attributes
- A
type of the value to parse
- bbuf
the byte buffer which will be parsed
- codec
a codec for the given
A
type- config
a parsing configuration
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for the result type, also in case if end of input is detected while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,bbuf
orconfig
is null
Deserialize JSON content encoded in UTF-8 from a byte buffer into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte buffer into a value of given A
type.
Parsing will start from the current position and will continue until the limit of the provided byte buffer or the value will be parsed before reaching of the limit. In any case the buffer position will be set to the next position after the last read byte.
While it is less efficient than parsing from a byte buffer using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- bbuf
the byte buffer which will be parsed
- codec
a codec for the given
A
type- config
a parsing configuration
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for the result type, also in case if end of input is detected while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,bbuf
orconfig
is null
Deserialize JSON content encoded in UTF-8 from an input stream into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from an input stream into a value of given A
type.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is null
Deserialize JSON content encoded in UTF-8 from an input stream into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from an input stream into a value of given A
type.
While it is less efficient than scanning JSON values from an input stream using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is null
Deserialize JSON content from a string into a value of given A
type.
Deserialize JSON content from a string into a value of given A
type.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- s
a value of string which will be parsed
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains invalid JSON content or the input JSON structure does not match structure that expected for the result type, also in case if end of input is detected while some input characters are expected
java.lang.NullPointerExceptionif any of
codec
,s
orconfig
is null
Deserialize JSON content from a string into a value of given A
type.
Deserialize JSON content from a string into a value of given A
type.
While it is less efficient than parsing from a string using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- s
a value of string which will be parsed
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains invalid JSON content or the input JSON structure does not match structure that expected for the result type, also in case if end of input is detected while some input characters are expected
java.lang.NullPointerExceptionif any of
codec
,s
orconfig
is null
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Attributes
- A
type of the value to parse
- buf
the byte array to parse from
- codec
a codec for the given
A
type- config
a parsing configuration
- from
the start position of the provided byte array
- to
the position of end of input in the provided byte array
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also in case if end of input is detected while some input bytes are expected
java.lang.ArrayIndexOutOfBoundsExceptionif the
to
is greater thanbuf
length or negative, orfrom
is greater thanto
or negativejava.lang.NullPointerExceptionif any of
codec
,buf
orconfig
is null
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
Deserialize JSON content encoded in UTF-8 from a byte array into a value of given A
type.
While it is less efficient than parsing from a sub array using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- buf
the byte array to parse from
- codec
a codec for the given
A
type- config
a parsing configuration
- from
the start position of the provided byte array
- to
the position of end of input in the provided byte array
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also in case if end of input is detected while some input bytes are expected
java.lang.ArrayIndexOutOfBoundsExceptionif the
to
is greater thanbuf
length or negative, orfrom
is greater thanto
or negativejava.lang.NullPointerExceptionif any of
codec
,buf
orconfig
is null
Deserialize JSON array encoded in UTF-8 from an input stream into its values of given A
type.
Deserialize JSON array encoded in UTF-8 from an input stream into its values of given A
type.
All parsed values will be passed to consuming function f
.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- f
a consumer of values, that returns
true
to continue scanning orfalse
to complete it- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is nulljava.lang.Throwableif some error was thrown by f() call
Deserialize JSON array encoded in UTF-8 from an input stream into its values of given A
type.
Deserialize JSON array encoded in UTF-8 from an input stream into its values of given A
type.
All parsed values will be passed to consuming function f
.
While it is less efficient than scanning JSON array from an input stream using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- f
a consumer of values, that returns
true
to continue scanning orfalse
to complete it- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is nulljava.lang.Throwableif some error was thrown by f() call
Deserialize JSON of streaming values encoded in UTF-8 from an input stream into values of given A
type.
Deserialize JSON of streaming values encoded in UTF-8 from an input stream into values of given A
type.
All parsed values will be passed to consuming function f
.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- f
a consumer of values, that returns
true
to continue scanning orfalse
to complete it- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is nulljava.lang.Throwableif some error was thrown by f() call
Deserialize JSON of streaming values encoded in UTF-8 from an input stream into values of given A
type.
Deserialize JSON of streaming values encoded in UTF-8 from an input stream into values of given A
type.
All parsed values will be passed to consuming function f
.
While it is less efficient than scanning JSON values from an input stream using pooled readers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of the value to parse
- codec
a codec for the given
A
type- config
a parsing configuration
- f
a consumer of values, that returns
true
to continue scanning orfalse
to complete it- in
the input stream to parse from
- Returns:
a successfully parsed value
- Throws:
- JsonReaderException
if underlying input contains malformed UTF-8 bytes, invalid JSON content or the input JSON structure does not match structure that expected for result type, also if a low-level I/O problem (unexpected end-of-input, network error) occurs while some input bytes are expected
java.lang.NullPointerExceptionif any of
codec
,in
orconfig
is nulljava.lang.Throwableif some error was thrown by f() call
Serialize the x
argument to a new allocated instance of byte array in UTF-8 encoding of JSON format.
Serialize the x
argument to a new allocated instance of byte array in UTF-8 encoding of JSON format.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Returns:
a byte array with
x
serialized to JSON- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
orconfig
is null
Serialize the x
argument to a new allocated instance of byte array in UTF-8 encoding of JSON format.
Serialize the x
argument to a new allocated instance of byte array in UTF-8 encoding of JSON format.
While it is less efficient than serialization to a byte array using pooled writers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Returns:
a byte array with
x
serialized to JSON- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
orconfig
is null
Serialize the x
argument to the given instance of byte buffer in UTF-8 encoding of JSON format.
Serialize the x
argument to the given instance of byte buffer in UTF-8 encoding of JSON format.
Serialization will start from the current position up to the provided byte buffer limit. On return the byte buffer will has position set to the next position after the last written byte.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of value to serialize
- bbuf
a byte buffer where the value should be serialized
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
,bbuf
orconfig
is nulljava.nio.BufferOverflowExceptionif the
bbuf
limit was exceeded during serializationjava.nio.ReadOnlyBufferExceptionif the
bbuf
is read-only
Serialize the x
argument to the given instance of byte buffer in UTF-8 encoding of JSON format.
Serialize the x
argument to the given instance of byte buffer in UTF-8 encoding of JSON format.
Serialization will start from the current position up to the provided byte buffer limit. On return the byte buffer will has position set to the next position after the last written byte.
While it is less efficient than serialization to a byte buffer pooled writers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of value to serialize
- bbuf
a byte buffer where the value should be serialized
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
,bbuf
orconfig
is nulljava.nio.BufferOverflowExceptionif the
bbuf
limit was exceeded during serializationjava.nio.ReadOnlyBufferExceptionif the
bbuf
is read-only
Serialize the x
argument to the provided output stream in UTF-8 encoding of JSON format.
Serialize the x
argument to the provided output stream in UTF-8 encoding of JSON format.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- out
an output stream to serialize into
- x
the value to serialize
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.io.IOExceptionif an I/O error occurs in a call to output stream
java.lang.NullPointerExceptionif any of
x
,codec
,out
orconfig
is null
Serialize the x
argument to the provided output stream in UTF-8 encoding of JSON format.
Serialize the x
argument to the provided output stream in UTF-8 encoding of JSON format.
While it is less efficient than serialization to an output stream using pooled writers but it can be safely used with a non-reentrant call is used in the same thread stack.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- out
an output stream to serialize into
- x
the value to serialize
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.io.IOExceptionif an I/O error occurs in a call to output stream
java.lang.NullPointerExceptionif any of
x
,codec
,out
orconfig
is null
Serialize the x
argument to a string in JSON format.
Serialize the x
argument to a string in JSON format.
BEWARE: It is a non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Returns:
a string with
x
serialized to JSON- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
orconfig
is null
Serialize the x
argument to a string in JSON format.
Serialize the x
argument to a string in JSON format.
While it is less efficient than serialization to a string using pooled writers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of value to serialize
- codec
a codec for the given value
- config
a serialization configuration
- x
the value to serialize
- Returns:
a string with
x
serialized to JSON- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.NullPointerExceptionif any of
x
,codec
orconfig
is null
Serialize the x
argument to the given instance of byte array in UTF-8 encoding of JSON format.
Serialize the x
argument to the given instance of byte array in UTF-8 encoding of JSON format.
BEWARE: It is non-reentrant routine and should not be used in a nested way in the same thread.
Attributes
- A
type of value to serialize
- buf
a byte array where the value should be serialized
- codec
a codec for the given value
- config
a serialization configuration
- from
a position in the byte array from which serialization of the value should start
- to
an exclusive position in the byte array that limits where serialization of the value should stop
- x
the value to serialize
- Returns:
number of next position after last byte serialized to
buf
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.ArrayIndexOutOfBoundsExceptionif the
from
is greater thanto
or negative, if 'to' is greater thanbuf
length orto
limit was exceeded during serializationjava.lang.NullPointerExceptionif any of
x
,codec
,buf
orconfig
is null
Serialize the x
argument to the given instance of byte array in UTF-8 encoding of JSON format.
Serialize the x
argument to the given instance of byte array in UTF-8 encoding of JSON format.
While it is less efficient than serialization to a sub array using pooled writers but it can be safely used when a non-reentrant call is used in the same thread stack.
Attributes
- A
type of value to serialize
- buf
a byte array where the value should be serialized
- codec
a codec for the given value
- config
a serialization configuration
- from
a position in the byte array from which serialization of the value should start
- to
an exclusive position in the byte array that limits where serialization of the value should stop
- x
the value to serialize
- Returns:
number of next position after last byte serialized to
buf
- Throws:
- JsonWriterException
if the value to serialize contains strings, double or float values which cannot be properly encoded
java.lang.ArrayIndexOutOfBoundsExceptionif the
from
is greater thanto
or negative, if 'to' is greater thanbuf
length orto
limit was exceeded during serializationjava.lang.NullPointerExceptionif any of
x
,codec
,buf
orconfig
is null