code: public String readString(final JBBPByteOrder byteOrder) throws IOException {
      final int prefix = this.readByte();
      final int len;
      if (prefix == 0) {
        len = 0;
      } else if (prefix == 0xFF) {
        len = -1;
      } else if (prefix < 0x80) {
        len = prefix;
      } else if ((prefix & 0xF0) == 0x80) {
        switch (prefix & 0x0F) {
          case 1: {
            len = this.readByte();
          }
          break;
          case 2: {
            len = this.readUnsignedShort(byteOrder);
          }
          break;
          case 3: {
            int buffer;
            if (byteOrder == JBBPByteOrder.BIG_ENDIAN) {
              buffer = (this.readByte() << 16) | (this.readByte() << 8) | this.readByte();
            } else {
              buffer = this.readByte() | (this.readByte() << 8) | (this.readByte() << 16);
            }
            len = buffer;
          }
          break;
          case 4: {
            len = this.readInt(byteOrder);
          }
          break;
          default: {
            throw makeIOExceptionForWrongPrefix(prefix);
          }
        }
      } else {
        throw makeIOExceptionForWrongPrefix(prefix);
      }
  
      final String result;
      if (len < 0) {
        result = null;
      } else if (len == 0) {
        result = "";
      } else {
        result = JBBPUtils.utf8ToStr(this.readByteArray(len));
      }
  
      return result;
    }
docs: Read string in UTF8 format.
  
  @param byteOrder byte order, must not be null
  @return read string, can be null
  @throws IOException it will be thrown for transport error or wrong format
  @see JBBPBitOutputStream#writeString(String, JBBPByteOrder)
  @since 1.4.0