Operation control

Ingvar Stepanyan edited this page Aug 27, 2013 · 2 revisions

jDataView has addition of extra littleEndian argument to the constructor. Big Endian will be the default mode of all the I/O operations if their littleEndian value is not passed explicitly.

  • jDataView(buffer, offset, length, littleEndian = false)

The byteOffset parameter is now optional. If you omit it, it will read right after the latest read offset, just like you're operating on data stream not blob. You can still interact with the internal pointer with those functions:

  • seek(byteOffset)
    • Moves the internal pointer to the position
  • tell()
    • Returns the current position
  • skip(byteLength)
    • Skips given count of bytes
  • slice(start, end, forceCopy = false)
    • Returns view (jDataView) on part of original one; may point to the same memory buffer or copy data into new one depending on forceCopy parameter.