Options
All
  • Public
  • Public/Protected
  • All
Menu

Reader helper for Portable objects.

Hierarchy

  • PortableReader

Index

Methods

getFieldNames

  • getFieldNames(): string[]
  • Returns string[]

    set of field names on this Portable class

getFieldType

  • getFieldType(fieldName: string): FieldType
  • throws

    RangeError if the field does not exist.

    Parameters

    • fieldName: string

      name of the field

    Returns FieldType

    field type of given fieldName

getVersion

  • getVersion(): number
  • Returns number

    global version of Portable classes

hasField

  • hasField(fieldName: string): boolean
  • Parameters

    • fieldName: string

      name of the field (does not support nested paths)

    Returns boolean

    true if field exist in this class.

readBoolean

  • readBoolean(fieldName: string): boolean
  • Reads a primitive boolean.

    Parameters

    • fieldName: string

      name of the field

    Returns boolean

    the boolean value read

readBooleanArray

  • readBooleanArray(fieldName: string): boolean[]
  • Reads an array of primitive booleans.

    Parameters

    • fieldName: string

      name of the field

    Returns boolean[]

    the boolean array value read

readByte

  • readByte(fieldName: string): number
  • Reads a 8-bit unsigned integer.

    Parameters

    • fieldName: string

      name of the field

    Returns number

    the byte value read

readByteArray

  • readByteArray(fieldName: string): Buffer
  • Reads an array of bytes.

    Parameters

    • fieldName: string

      name of the field

    Returns Buffer

    the byte array value read

readChar

  • readChar(fieldName: string): string
  • Reads a single character string using String.fromCharCode from two bytes of UTF-16 code units.

    Parameters

    • fieldName: string

      name of the field

    Returns string

    the char value read

readCharArray

  • readCharArray(fieldName: string): string[]
  • Reads an array of single character strings. Each of them are read using String.fromCharCode from a two bytes UTF-16 code units.

    Parameters

    • fieldName: string

      name of the field

    Returns string[]

    the char array value read

readDate

  • readDate(fieldName: string): LocalDate
  • Reads a date.

    Parameters

    • fieldName: string

      name of the field

    Returns LocalDate

    the LocalDate value read

readDateArray

  • readDateArray(fieldName: string): LocalDate[]
  • Reads an array of LocalDates.

    see

    readDate

    Parameters

    • fieldName: string

      name of the field

    Returns LocalDate[]

    the LocalDate array read

readDecimal

  • readDecimal(fieldName: string): BigDecimal
  • Reads a decimal.

    Parameters

    • fieldName: string

      name of the field

    Returns BigDecimal

    the BigDecimal value read

readDecimalArray

  • readDecimalArray(fieldName: string): BigDecimal[]
  • Reads an array of BigDecimals.

    see

    readDecimal

    Parameters

    • fieldName: string

      name of the field

    Returns BigDecimal[]

    the BigDecimal array read

readDouble

  • readDouble(fieldName: string): number
  • Reads a double.

    Parameters

    • fieldName: string

      name of the field

    Returns number

    the double value read

readDoubleArray

  • readDoubleArray(fieldName: string): number[]
  • Reads an array of doubles.

    Parameters

    • fieldName: string

      name of the field

    Returns number[]

    the double array value read

readFloat

  • readFloat(fieldName: string): number
  • Reads a float.

    Parameters

    • fieldName: string

      name of the field

    Returns number

    the float value read

readFloatArray

  • readFloatArray(fieldName: string): number[]
  • Reads an array of floats.

    Parameters

    • fieldName: string

      name of the field

    Returns number[]

    the float array value read

readInt

  • readInt(fieldName: string): number
  • Reads a 32-bit signed integer.

    Parameters

    • fieldName: string

      name of the field

    Returns number

    the int value read

readIntArray

  • readIntArray(fieldName: string): number[]
  • Reads an array of 32-bit signed integers.

    Parameters

    • fieldName: string

      name of the field

    Returns number[]

    the int array value read

readLong

  • readLong(fieldName: string): Long
  • Reads a long.

    Parameters

    • fieldName: string

      name of the field

    Returns Long

    the long value read

readLongArray

  • readLongArray(fieldName: string): Long[]
  • Reads an array of longs.

    Parameters

    • fieldName: string

      name of the field

    Returns Long[]

    the long array value read

readPortable

  • readPortable(fieldName: string): Portable
  • Reads a Portable.

    Parameters

    • fieldName: string

      name of the field

    Returns Portable

    the Portable value read

readPortableArray

  • readPortableArray(fieldName: string): Portable[]
  • Reads an array of Portables.

    Parameters

    • fieldName: string

      name of the field

    Returns Portable[]

    the Portable array read

readShort

  • readShort(fieldName: string): number
  • Reads a 16-bit signed integer.

    Parameters

    • fieldName: string

      name of the field

    Returns number

    the short value read

readShortArray

  • readShortArray(fieldName: string): number[]
  • Reads an array of 16-bit signed integers.

    Parameters

    • fieldName: string

      name of the field

    Returns number[]

    the short array value read

readString

  • readString(fieldName: string): string
  • Reads a string from UTF-8 encoded bytes.

    Parameters

    • fieldName: string

      name of the field

    Returns string

    the string value read

readStringArray

  • readStringArray(fieldName: string): string[]
  • Reads an array of strings. Strings are read using UTF-8 encoding.

    Parameters

    • fieldName: string

      name of the field

    Returns string[]

    the string array value read

readTime

  • Reads a time.

    Parameters

    • fieldName: string

      name of the field

    Returns LocalTime

    the LocalTime value read

readTimeArray

  • readTimeArray(fieldName: string): LocalTime[]
  • Reads an array of LocalTimes.

    see

    readTime

    Parameters

    • fieldName: string

      name of the field

    Returns LocalTime[]

    the LocalTime array read

readTimestamp

  • Reads a timestamp.

    Parameters

    • fieldName: string

      name of the field

    Returns LocalDateTime

    the LocalDateTime value read

readTimestampArray

  • Reads an array of LocalDateTimes.

    see

    readTimestamp

    Parameters

    • fieldName: string

      name of the field

    Returns LocalDateTime[]

    the LocalDateTime array read

readTimestampWithTimezone

  • readTimestampWithTimezone(fieldName: string): OffsetDateTime
  • Reads a timestamp with timezone.

    Parameters

    • fieldName: string

      name of the field

    Returns OffsetDateTime

    the OffsetDateTime value read

readTimestampWithTimezoneArray

  • readTimestampWithTimezoneArray(fieldName: string): OffsetDateTime[]
  • Reads an array of OffsetDateTimes.

    see

    readTimestampWithTimezone

    Parameters

    • fieldName: string

      name of the field

    Returns OffsetDateTime[]

    the OffsetDateTime array read

readUTF

  • readUTF(fieldName: string): string
  • Reads a string from UTF-8 encoded bytes.

    deprecated

    since version 4.2 for the sake of better naming. Please use readString instead.

    Parameters

    • fieldName: string

      name of the field

    Returns string

    the UTF string value read

readUTFArray

  • readUTFArray(fieldName: string): string[]
  • Reads an array strings. Strings are read using UTF-8 encoding.

    deprecated

    since version 4.2 for the sake of better naming. Please use readStringArray instead

    Parameters

    • fieldName: string

      name of the field

    Returns string[]

    the string array value read

Generated using TypeDoc