Skip to content

Strings and Blobs

Ingvar Stepanyan edited this page · 3 revisions

jDataView has support for additional Char, String and Bytes types.

String operations globally support 'binary' (by default) and 'utf-8' encodings; Char is always one-byte 'binary'.

In Node.js and browsers with native or polyfilled TextEncoder/TextDecoder support other encodings will be supported, too.

  • getChar(byteOffset)
  • setChar(byteOffset, char)
  • writeChar(char)
  • getString(byteLength, byteOffset, encoding = 'binary')
  • setString(byteOffset, chars, encoding = 'binary')
  • writeString(chars, encoding = 'binary')
  • getBytes(length, byteOffset, littleEndian = true, toArray = false)
  • setBytes(byteOffset, bytes, littleEndian = true)
  • writeBytes(bytes, littleEndian = true)
Something went wrong with that request. Please try again.