code: public static String readZeroTerminatedString(ByteBuffer buffer, int strLen) {
          StringBuilder sb = new StringBuilder(strLen);
          for (int i = 0; i < strLen; i++) {
              char c = buffer.getChar();
              if (c == '\0') {
                  skip(buffer, (strLen - i - 1) * 2);
                  break;
              }
              sb.append(c);
          }
          return sb.toString();
      }
docs: read utf16 strings, ending with 0 char.