private static int findNextSymbolBeginningOffsetFrom_UTF16(long numberOfStartByte,
                                                             RandomAccessFile randomAccessFile,
                                                             Charset charset) throws IOException {
    // utf16-text only consists of words (word = 2 bytes)
    long offset = numberOfStartByte % 2;

    // taking the HIGH byte of the word
    if (charset.compareTo(StandardCharsets.UTF_16) == 0 || charset.compareTo(StandardCharsets.UTF_16BE) == 0) {
      randomAccessFile.seek(numberOfStartByte + offset);
    }
    else {
      randomAccessFile.seek(numberOfStartByte + offset + 1);
    }

    int unsignedByte = randomAccessFile.readByte() & 0xFF; // (<byte> & 0xFF) returns unsigned integer value of <byte>
    if (unsignedByte <= 0xD8 || unsignedByte >= 0xE0) {
      return (int)offset;  // it is sym=1word
    }
    else if (unsignedByte <= 0xDB) {
      return (int)offset;  // it is high word of sym=2words
    }
    else {
      return (int)offset + 2; // it is low word of syn=2words
    }
  }
private static int findNextSymbolBeginningOffsetFrom_UTF16(long numberOfStartByte,
                                                             RandomAccessFile randomAccessFile,
                                                             Charset charset)