Returns the current value as a BigInt
. This is only valid if type() == IonTypes.INT
.
Returns the current value as a boolean
. This is only valid if type() == IonTypes.BOOL
.
Returns the depth of the reader. This is 0
if the reader is not inside of a container.
Returns the field name of the current value.
Indicates whether the current int value is small enough to be stored in a number without loss of precision or if a BigInt is required.
Returns true if and only if the reader is positioned on a null
value of any type.
Advances the reader to the next value in the stream at the current depth.
Returns the current value as a number
. This is only valid if type() == IonTypes.INT
or type() == IonTypes.FLOAT
.
Returns the Reader's offset from the beginning of its input.
For binary Readers, the return value is the number of bytes that have been processed.
For text Readers, the return value is the number of UTF-16 code units that have been processed, regardless of the input's original encoding. For more on JavaScript's in-memory representation of text, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description
Note that a Reader cannot safely skip to a given position in input without processing the stream leading up to that position. This is because there are mid-stream system level values that must be processed to guarantee that the Reader is in a valid state. It is safe, however, to start at the beginning of a data source and call next() until you reach the desired position, as the reader will still have the opportunity to process system-level values along the way.
Steps into the container the reader is currently positioned on. Note that this positions the reader before the first value within the container.
Steps out of the current container. This is only valid when the reader is inside of a container
(i.e. depth() > 0
). Note that the positions the reader after the container that was
stepped out of, but before the next value after the container. One should generally
call next after invoking this method.
Returns the current value as a string
. This is only valid if type() == IonTypes.STRING
or type() == IonTypes.SYMBOL
.
Returns the current value as a Uint8Array
. This is only valid if type() == IonTypes.CLOB
or type() == IonTypes.BLOB
.
Returns the current scalar value. This is only valid when type().scalar == true
.
Returns the annotations for the current value.