In other words, take the squared mean of the dataset, from this, find the square root. Simples

You haven't given a clear indication to what exactly you want to use with RMS for but I can make the assumtion that you need to carry out some kind of thresholding, if this is the case then:

1) Split your signal into segments
2) Calculate the RMS for each of these segments.

Here is the code written in MATLAB

function rms = quadraticMean(list)
rms = sqrt(mean(list.^2));
end

public class Main {
public static void main(String[] args) {
long timeCheck;
long periodOfTime;
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2);
long initialDelay = 0; // ...