private static String readFully(BufferedReader buffered) throws IOException {
    // use Groovy's methods as they keep the correct line endings
    return IOGroovyMethods.getText(buffered);
  }
Returns the text read from the given reader as a String.
Closes the given reader upon return.
spock-core/src/main/java/org/spockframework/util/IoUtil.java