getASCIIZ method

String getASCIIZ()

Read until a null terminator, return the string and updates the pointer.

Implementation

String getASCIIZ() {
  var result = '';
  var byte = -1;

  while (byte != 0) {
    byte = getByte();
    if (byte != 0) {
      result += String.fromCharCode(byte);
    }
  }

  return result;
}