code: protected InstallRequest buildInstallRequest(MemberState member) {
      Snapshot snapshot = context.getSnapshotStore().currentSnapshot();
      if (member.getNextSnapshotIndex() != snapshot.index()) {
        member.setNextSnapshotIndex(snapshot.index()).setNextSnapshotOffset(0);
      }
  
      InstallRequest request;
      synchronized (snapshot) {
        // Open a new snapshot reader.
        try (SnapshotReader reader = snapshot.reader()) {
          // Skip to the next batch of bytes according to the snapshot chunk size and current offset.
          reader.skip(member.getNextSnapshotOffset() * MAX_BATCH_SIZE);
          byte[] data = new byte[Math.min(MAX_BATCH_SIZE, (int) reader.remaining())];
          reader.read(data);
  
          // Create the install request, indicating whether this is the last chunk of data based on the number
          // of bytes remaining in the buffer.
          ServerMember leader = context.getLeader();
          request = InstallRequest.builder()
            .withTerm(context.getTerm())
            .withLeader(leader != null ? leader.id() : 0)
            .withIndex(member.getNextSnapshotIndex())
            .withOffset(member.getNextSnapshotOffset())
            .withData(data)
            .withComplete(!reader.hasRemaining())
            .build();
        }
      }
  
      return request;
    }
docs: Builds an install request for the given member.