docs: @Nullable
      private static byte[] decodeHexCommentBlock(@NotNull SequentialReader reader) throws IOException
      {
          ByteArrayOutputStream bytes = new ByteArrayOutputStream();
  
          // Use a state machine to efficiently parse data in a single traversal
  
          final int AwaitingPercent = 0;
          final int AwaitingSpace = 1;
          final int AwaitingHex1 = 2;
          final int AwaitingHex2 = 3;
  
          int state = AwaitingPercent;
  
          int carry = 0;
          boolean done = false;
  
          byte b = 0;
          while (!done) {
              b = reader.getByte();
  
              switch (state) {
                  case AwaitingPercent: {
                      switch (b) {
                          case '\r':
                          case '\n':
                          case ' ':
                              // skip newline chars and spaces
                              break;
                          case '%':
                              state = AwaitingSpace;
                              break;
                          default:
                              return null;
                      }
                      break;
                  }
                  case AwaitingSpace: {
                      switch (b) {
                          case ' ':
                              state = AwaitingHex1;
                              break;
                          default:
                              done = true;
                              break;
                      }
                      break;
                  }
                  case AwaitingHex1: {
                      int i = tryHexToInt(b);
                      if (i != -1) {
                          carry = i * 16;
                          state = AwaitingHex2;
                      } else if (b == '\r' || b == '\n') {
                          state = AwaitingPercent;
                      } else {
                          return null;
                      }
                      break;
                  }
                  case AwaitingHex2: {
                      int i = tryHexToInt(b);
                      if (i == -1)
                          return null;
                      bytes.write(carry + i);
                      state = AwaitingHex1;
                      break;
                  }
              }
          }
  
          // skip through the remainder of the last line
          while (b != '\n')
              b = reader.getByte();
  
          return bytes.toByteArray();
      }