Options
All
  • Public
  • Public/Protected
  • All
Menu

Writer helper for Portable objects.

Hierarchy

  • PortableWriter

Index

Methods

writeBoolean

  • writeBoolean(fieldName: string, value: boolean): void
  • Writes a primitive boolean.

    Parameters

    • fieldName: string

      name of the field

    • value: boolean

      boolean value to be written

    Returns void

writeBooleanArray

  • writeBooleanArray(fieldName: string, booleans: boolean[]): void
  • Writes an array of primitive booleans.

    Parameters

    • fieldName: string

      name of the field

    • booleans: boolean[]

      boolean array to be written

    Returns void

writeByte

  • writeByte(fieldName: string, value: number): void
  • Writes a number as 8-bit unsigned integer.

    Parameters

    • fieldName: string

      name of the field

    • value: number

      byte value to be written. Must be a valid unsigned 8-bit integer. Behaviour is undefined when value is anything other than a unsigned 8-bit integer.

    Returns void

writeByteArray

  • writeByteArray(fieldName: string, bytes: Buffer): void
  • Writes a Buffer as byte array.

    Parameters

    • fieldName: string

      name of the field

    • bytes: Buffer

      Buffer to be written

    Returns void

writeChar

  • writeChar(fieldName: string, value: string): void
  • Writes a single character string using char.charCodeAt(0).

    A two-byte unsigned integer representing the UTF-16 code unit value of the single character string will be written.

    Parameters

    • fieldName: string

      name of the field

    • value: string

      char value to be written

    Returns void

writeCharArray

  • writeCharArray(fieldName: string, chars: string[]): void
  • Writes an array of single character strings using char.charCodeAt(0).

    For each single character string, a two-byte unsigned integer representing the UTF-16 code unit value will be written.

    Parameters

    • fieldName: string

      name of the field

    • chars: string[]

      char array to be written

    Returns void

writeDate

  • writeDate(fieldName: string, value: LocalDate): void
  • Writes a date.

    Parameters

    • fieldName: string

      name of the field

    • value: LocalDate

      LocalDate value to be written

    Returns void

writeDateArray

  • writeDateArray(fieldName: string, values: LocalDate[]): void
  • Writes an array of LocalDates.

    see

    writeDate

    Parameters

    • fieldName: string

      name of the field

    • values: LocalDate[]

      LocalDate array to be written

    Returns void

writeDecimal

  • writeDecimal(fieldName: string, value: BigDecimal): void
  • Writes a decimal.

    Parameters

    • fieldName: string

      name of the field

    • value: BigDecimal

      BigDecimal value to be written

    Returns void

writeDecimalArray

  • writeDecimalArray(fieldName: string, values: BigDecimal[]): void
  • Writes an array of BigDecimals.

    see

    writeDecimal

    Parameters

    • fieldName: string

      name of the field

    • values: BigDecimal[]

      BigDecimal array to be written

    Returns void

writeDouble

  • writeDouble(fieldName: string, value: number): void
  • Writes a number as double.

    Parameters

    • fieldName: string

      name of the field

    • value: number

      double value to be written. The value must be a JavaScript number. Behavior is undefined when value is anything other than a JavaScript number.

    Returns void

writeDoubleArray

  • writeDoubleArray(fieldName: string, values: number[]): void
  • Writes an array of numbers as doubles.

    Parameters

    • fieldName: string

      name of the field

    • values: number[]

      double array to be written. Each value must be a JavaScript number. Behavior is undefined when any value is anything other than a JavaScript number.

    Returns void

writeFloat

  • writeFloat(fieldName: string, value: number): void
  • Writes a number as float.

    Parameters

    • fieldName: string

      name of the field

    • value: number

      float value to be written. The value must be a JavaScript number. Behavior is undefined when value is anything other than a JavaScript number.

    Returns void

writeFloatArray

  • writeFloatArray(fieldName: string, values: number[]): void
  • Writes an array of numbers as floats.

    Parameters

    • fieldName: string

      name of the field

    • values: number[]

      float array to be written. Each value must be a JavaScript number. Behavior is undefined when any value is anything other than a JavaScript number.

    Returns void

writeInt

  • writeInt(fieldName: string, value: number): void
  • Writes a number as 32-bit signed integer.

    Parameters

    • fieldName: string

      name of the field

    • value: number

      int value to be written. The value must be a valid signed 32-bit integer. Behavior is undefined when value is anything other than a signed 32-bit integer.

    Returns void

writeIntArray

  • writeIntArray(fieldName: string, ints: number[]): void
  • Writes an array of numbers as 32-bit signed integer array.

    Parameters

    • fieldName: string

      name of the field

    • ints: number[]

      int array to be written. Each value must be a valid signed 32-bit integer. Behavior is undefined when any value is anything other than a signed 32-bit integer.

    Returns void

writeLong

  • writeLong(fieldName: string, value: Long): void
  • Writes a long.

    Parameters

    • fieldName: string

      name of the field

    • value: Long

      long value to be written

    Returns void

writeLongArray

  • writeLongArray(fieldName: string, longs: Long[]): void
  • Writes an array of longs.

    Parameters

    • fieldName: string

      name of the field

    • longs: Long[]

      long array to be written

    Returns void

writeNullPortable

  • writeNullPortable(fieldName: string, factoryId: number, classId: number): void
  • To write a null Portable value, you need to provide class and factory IDs of the related class.

    Parameters

    • fieldName: string

      name of the field

    • factoryId: number

      factory ID of related Portable class

    • classId: number

      class ID of related Portable class

    Returns void

writePortable

  • writePortable(fieldName: string, Portable: Portable): void
  • Writes a Portable. Use writeNullPortable to write a null Portable

    Parameters

    • fieldName: string

      name of the field

    • Portable: Portable

      Portable to be written

    Returns void

writePortableArray

  • writePortableArray(fieldName: string, values: Portable[]): void
  • Writes an array Portables.

    Parameters

    • fieldName: string

      name of the field

    • values: Portable[]

      Portable array to be written

    Returns void

writeShort

  • writeShort(fieldName: string, value: number): void
  • Writes a number as 16-bit signed integer.

    Parameters

    • fieldName: string

      name of the field

    • value: number

      short value to be written. The value must be a valid signed 16-bit integer. Behavior is undefined when value is anything other than an signed 16-bit integer.

    Returns void

writeShortArray

  • writeShortArray(fieldName: string, values: number[]): void
  • Writes an array of numbers as 16-bit signed integers.

    Parameters

    • fieldName: string

      name of the field

    • values: number[]

      short array to be written. Each value must be a valid signed 16-bit integer. Behavior is undefined when any value is anything other than a signed 16-bit integer.

    Returns void

writeString

  • writeString(fieldName: string, value: string): void
  • Writes a string as UTF-8 encoded bytes.

    Parameters

    • fieldName: string

      name of the field

    • value: string

      UTF string value to be written

    Returns void

writeStringArray

  • writeStringArray(fieldName: string, values: string[]): void
  • Writes an array of strings. Each string is written as UTF-8 encoded bytes.

    Parameters

    • fieldName: string

      name of the field

    • values: string[]

      string array to be written

    Returns void

writeTime

  • writeTime(fieldName: string, value: LocalTime): void
  • Write a time.

    Parameters

    • fieldName: string

      name of the field

    • value: LocalTime

      LocalTime value to be written

    Returns void

writeTimeArray

  • writeTimeArray(fieldName: string, values: LocalTime[]): void
  • Writes an array of LocalTimes.

    see

    writeTime

    Parameters

    • fieldName: string

      name of the field

    • values: LocalTime[]

      LocalTime array to be written

    Returns void

writeTimestamp

  • writeTimestamp(fieldName: string, value: LocalDateTime): void
  • Writes a timestamp.

    Parameters

    • fieldName: string

      name of the field

    • value: LocalDateTime

      LocalDateTime value to be written

    Returns void

writeTimestampArray

  • writeTimestampArray(fieldName: string, values: LocalDateTime[]): void
  • Writes an array of LocalDateTimes.

    see

    writeTimestamp

    Parameters

    • fieldName: string

      name of the field

    • values: LocalDateTime[]

      LocalDateTime array to be written

    Returns void

writeTimestampWithTimezone

  • writeTimestampWithTimezone(fieldName: string, value: OffsetDateTime): void
  • Writes a timestamp with timezone.

    Parameters

    • fieldName: string

      name of the field

    • value: OffsetDateTime

      OffsetDateTime value to be written

    Returns void

writeTimestampWithTimezoneArray

  • writeTimestampWithTimezoneArray(fieldName: string, values: OffsetDateTime[]): void
  • Writes an array of OffsetDateTimes.

    see

    writeTimestampWithTimezone

    Parameters

    • fieldName: string

      name of the field

    • values: OffsetDateTime[]

      OffsetDateTime array to be written

    Returns void

writeUTF

  • writeUTF(fieldName: string, value: string): void
  • Writes a string as UTF-8 encoded bytes.

    deprecated

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

    Parameters

    • fieldName: string

      name of the field

    • value: string

      UTF string value to be written

    Returns void

writeUTFArray

  • writeUTFArray(fieldName: string, values: string[]): void
  • Writes an array of strings. Each string is written as UTF-8 encoded bytes.

    deprecated

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

    Parameters

    • fieldName: string

      name of the field

    • values: string[]

      string array to be written

    Returns void

Generated using TypeDoc